metanorma / pubid-ieee

PubID spec and implementation for IEEE deliverables
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Some fixes #78

Closed ronaldtse closed 1 year ago

ronaldtse commented 1 year ago

Metanorma PR checklist

ronaldtse commented 1 year ago

Errors in the previous build of

Failures:

  1) Pubid::Ieee::Identifier parse specific identifiers IEEE/ISO/IEC 8802-3:2021/Amd8-2021 behaves like converts pubid to pubid converts pubid to pubid
     Failure/Error: raise Pubid::Ieee::Errors::ParseError, "#{failure.message}\ncause: #{failure.parse_failure_cause.ascii_tree}"

     Pubid::Ieee::Errors::ParseError:
       Expected one of [ISO_IDENTIFIER ISO_PARAMETERS, ISO_IDENTIFIER SPACE (ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?), ISO_IDENTIFIER, (ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?)] at line 1 char 1.
       cause: Expected one of [ISO_IDENTIFIER ISO_PARAMETERS, ISO_IDENTIFIER SPACE (ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?), ISO_IDENTIFIER, (ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?)] at line 1 char 1.
       |- Failed to match sequence (ISO_IDENTIFIER ISO_PARAMETERS) at line 1 char 30.
       |  `- Failed to match sequence (ISO_AMENDMENT? parameters:(DUAL_PUBID_WITHOUT_PARAMETERS? (PUBLICATION_DATE SPACE? '(E)'?)? edition:EDITION? DRAFT? ADDITIONAL_PARAMETERS)) at line 1 char 30.
       |     `- Failed to match sequence (DUAL_PUBID_WITHOUT_PARAMETERS? (PUBLICATION_DATE SPACE? '(E)'?)? edition:EDITION? DRAFT? ADDITIONAL_PARAMETERS) at line 1 char 30.
       |        `- Failed to match sequence ((SPACE? '(' ((REAFFIRMED / REVISION / AMENDMENT / SUPERSEDES / CORRIGENDUM_COMMENT / INCORPORATES / SUPPLEMENT) (('/' / ',') SPACE?)?){0, } ')'?){0, } REDLINE?) at line 1 char 30.
       |           `- Extra input after last repetition at line 1 char 30.
       |              `- Failed to match sequence (' - ' redline:'Redline') at line 1 char 30.
       |                 `- Expected " - ", but got "-20" at line 1 char 30.
       |- Failed to match sequence (ISO_IDENTIFIER SPACE (ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?)) at line 1 char 30.
       |  `- Expected " ", but got "-" at line 1 char 30.
       |- Don't know what to do with "-2021" at line 1 char 30.
       `- Failed to match sequence ((ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?)) at line 1 char 18.
          `- Failed to match sequence ((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?) at line 1 char 20.
             `- Don't know what to do with ":2021/Amd8" at line 1 char 20.
     Shared Example Group: "converts pubid to pubid" called from ./spec/pubid_ieee/identifier_spec.rb:659
     # ./lib/pubid/ieee/identifier.rb:79:in `rescue in parse'
     # ./lib/pubid/ieee/identifier.rb:74:in `parse'
     # ./spec/pubid_ieee/identifier_spec.rb:2:in `block (2 levels) in <top (required)>'
     # ./spec/pubid_ieee/identifier_spec.rb:16:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Parslet::ParseFailed:
     #   Expected one of [ISO_IDENTIFIER ISO_PARAMETERS, ISO_IDENTIFIER SPACE (ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?), ISO_IDENTIFIER, (ORGANIZATIONS SPACE)? type_status:((DRAFT_STATUS SPACE)? ('Draft '? type:TYPE SPACE?)?) NUMBER_PREFIX NUMBER parameters:((DRAFT / PART_SUBPART_YEAR? CORRIGENDUM? DRAFT? ISO_AMENDMENT?) PUBLICATION_DATE? edition:EDITION? DUAL_PUBIDS? ADDITIONAL_PARAMETERS?)] at line 1 char 1.
     #   ./lib/pubid/ieee/identifier.rb:75:in `parse'

  2) Pubid::Ieee::Identifier parse identifiers from examples files parses identifiers from pubid-parsed.txt behaves like parse identifiers from file parse identifiers from file
     Failure/Error:
       expect do
         described_class.parse(pub_id)
       rescue Exception => failure
         raise Pubid::Ieee::Errors::ParseError,
               "couldn't parse #{pub_id}\n#{failure.message}"
       end.not_to raise_error

       expected no Exception, got #<Pubid::Ieee::Errors::ParseError: couldn't parse IEEE/ISO/IEC 8802-3:2021/Amd7-2021
       Expected one of ...ARAMETERS?) at line 1 char 20.
             `- Don't know what to do with ":2021/Amd7" at line 1 char 20.
       > with backtrace:
         # ./spec/pubid_ieee/identifier_spec.rb:840:in `rescue in block (6 levels) in <top (required)>'
         # ./spec/pubid_ieee/identifier_spec.rb:838:in `block (6 levels) in <top (required)>'
         # ./spec/pubid_ieee/identifier_spec.rb:837:in `block (5 levels) in <top (required)>'
         # ./spec/pubid_ieee/identifier_spec.rb:833:in `each'
         # ./spec/pubid_ieee/identifier_spec.rb:833:in `block (4 levels) in <top (required)>'
     Shared Example Group: "parse identifiers from file" called from ./spec/pubid_ieee/identifier_spec.rb:850
     # ./spec/pubid_ieee/identifier_spec.rb:837:in `block (5 levels) in <top (required)>'
     # ./spec/pubid_ieee/identifier_spec.rb:833:in `each'
     # ./spec/pubid_ieee/identifier_spec.rb:833:in `block (4 levels) in <top (required)>'

Finished in 17.94 seconds (files took 0.09853 seconds to load)
264 examples, 2 failures

Failed examples:

rspec ./spec/pubid_ieee/identifier_spec.rb[1:1:90:1:1] # Pubid::Ieee::Identifier parse specific identifiers IEEE/ISO/IEC 8802-3:2021/Amd8-2021 behaves like converts pubid to pubid converts pubid to pubid
rspec ./spec/pubid_ieee/identifier_spec.rb:831 # Pubid::Ieee::Identifier parse identifiers from examples files parses identifiers from pubid-parsed.txt behaves like parse identifiers from file parse identifiers from file

Are fixed in https://github.com/metanorma/pubid-iso/pull/68 .