diff --git a/docs/source/Appendix_B.md b/docs/source/Appendix_B.md index a571f3c..4f13b1a 100644 --- a/docs/source/Appendix_B.md +++ b/docs/source/Appendix_B.md @@ -357,6 +357,15 @@ when the planned XSD validation is implemented start with HED_XML. **a.** An attribute is used in the schema, but is not defined in the schema attribute section. **b.** A schema attribute is applied to the incorrect type (e.g., an element with the unit definition does appear under an appropriate unit class). +**c.** A schema attribute is used in an invalid way + +| Attribute | Invalid Usage Location | +|--------------------|----------------------------------------------------------------------------------------------------------------| +| `deprecatedFrom` | An element with a `deprecatedFrom` attribute has a child node that does not have a `deprecatedFrom` attribute. | +| `rooted` | See [SCHEMA_LIBRARY_INVALID](#SCHEMA_LIBRARY_INVALID) | +| `takesValue` | Used on a non-placeholder(#) node. | +| `unitClass` | Used on a non-placeholder(#) node. | +| `valueClass` | Used on a non-placeholder(#) node. | **Note:** - A `tag` element can have schema attributes that have the `nodeClassProperty` or the `elementProperty` or have no type property designator. @@ -368,20 +377,20 @@ under an appropriate unit class). #### SCHEMA_ATTRIBUTE_VALUE_INVALID -**a.** A non-boolean schema attribute has an invalid value as indicated by the following table. +**a.** A non-boolean schema attribute has an invalid value or usage as indicated by the following table. -| Attribute | Invalid attribute value | -| --------- |------------------------------------------------------------------------------------| +| Attribute | Invalid Attribute Value | +|-----------------|------------------------------------------------------------------------------------| | `allowedCharacter` | Not a single character or one of:
`letters`, `blank`, `digits`, `alphanumeric`. | -| `conversionFactor` | Not a positive numeric value. | -| `defaultUnits` | Not a valid unit in this unit class. | -| `deprecatedFrom` | Not a valid semantic version number not later than current schema version. | -| `inLibrary` | | -| `relatedTag` | | -| `rooted` | | -| `suggestedTag` | | -| `unitClass` | | -| `valueClass` | | +| `conversionFactor` | Not a positive numeric value. | +| `defaultUnits` | Not a valid unit in this unit class. | +| `deprecatedFrom` | Does not correspond to a valid schema version. | +| `inLibrary` | The value of an inLibrary attribute is for the wrong library. | +| `relatedTag` | Not an existing tag. | +| `rooted` | See [SCHEMA_LIBRARY_INVALID](#SCHEMA_LIBRARY_INVALID) | +| `suggestedTag` | Not an existing tag. | +| `unitClass` | Not an existing unit class. | +| `valueClass` | Not an existing value class. | #### SCHEMA_CHARACTER_INVALID @@ -412,8 +421,8 @@ Library schema errors are specific to library schema. Library schema may also ra #### SCHEMA_SECTION_MISSING **a.** A required schema section is missing. -**b.** The required sections (corresponding to the schema, unit classes, unit modifiers, value classes, -schema attributes, and properties) are not in the correct order and hence not detected. +**b.** The required sections (corresponding to the prologue, schema, unit classes, unit modifiers, value classes, +schema attributes, properties and epilogue) are not in the correct order and hence not detected. **Note:** Required schema sections may be empty, but still be given. @@ -423,13 +432,6 @@ schema attributes, and properties) are not in the correct order and hence not de **b.** A HED version specification does not have the correct syntax for the schema file format. **c.** A HED schema version does not comply with semantic versioning. -### B.2.2. Invalid usage error - -#### SCHEMA_DEPRECATED_INVALID - -**a.** The value of a `deprecatedFrom` attribute does not correspond to a valid schema version. -**b.** An element with a `deprecatedFrom` attribute has a child node that does not have a `deprecatedFrom` attribute. - ### B.2.3. Mediawiki format errors #### WIKI_DELIMITERS_INVALID @@ -437,6 +439,7 @@ schema attributes, and properties) are not in the correct order and hence not de **a.** Delimiters used in the wiki are invalid. **b.** Schema line content after node name is not enclosed with `` delimiters. **c.** A line has unmatched or multiple ``, `[ ]`, or `{ }` delimiters. +**d.** Attributes section of a node is malformed(eg hanging `=` character). #### WIKI_LINE_START_INVALID @@ -444,8 +447,8 @@ schema attributes, and properties) are not in the correct order and hence not de #### WIKI_SEPARATOR_INVALID -**a.** Required wiki section separator is missing or misplaced. -**b.** A required schema separator is missing. (The required separators are: `!# start schema`, `!# end schema`, and `!# end hed`.) +**a.** A malformed section separator is present +**b.** A duplicate section separator is present. ### B.2.4. XML format errors diff --git a/tests/hed_error_codes.json b/tests/hed_error_codes.json index a170346..7a50e44 100644 --- a/tests/hed_error_codes.json +++ b/tests/hed_error_codes.json @@ -31,9 +31,8 @@ ], "schema_validation_errors": [ "SCHEMA_ATTRIBUTE_INVALID", + "SCHEMA_ATTRIBUTE_VALUE_INVALID", "SCHEMA_CHARACTER_INVALID", - "SCHEMA_DEFAULT_UNITS_INVALID", - "SCHEMA_DEPRECATED_INVALID", "SCHEMA_DUPLICATE_NODE", "SCHEMA_HEADER_INVALID", "SCHEMA_LIBRARY_INVALID", diff --git a/tests/json_tests/SCHEMA_ATTRIBUTE_INVALID.json b/tests/json_tests/SCHEMA_ATTRIBUTE_INVALID.json index c74f6ca..aaa02ea 100644 --- a/tests/json_tests/SCHEMA_ATTRIBUTE_INVALID.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_INVALID.json @@ -11,18 +11,65 @@ "fails": [ [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", - "'''Tag-with-unknown''' {unknownAttribute=invalid}", + "'''Tag-with-unknown''' {unknownAttribute}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag-with-unknown''' {unitAttribute}", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes''' {unitProperty}", + "* unitAttribute {unitProperty}", + "'''Properties''' ", + "* unitProperty ", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers''' ", + "* mod1 {unitAttribute}[Wrong attribute type]", + "'''Value classes'''", + "'''Schema attributes''' {unitProperty}", + "* unitAttribute {unitProperty}", + "'''Properties''' ", + "* unitProperty ", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {suggestedTag=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_ALLOWED_CHARACTER.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_ALLOWED_CHARACTER.json new file mode 100644 index 0000000..90db77e --- /dev/null +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_ALLOWED_CHARACTER.json @@ -0,0 +1,60 @@ +[ + { + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", + "name": "attribute-invalid-allowed-character", + "warning": true, + "description": "A schema unit has an invalid conversion factor", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "'''Unit modifiers'''", + "'''Value classes'''", + "* testValueClass {allowedCharacter=?d}", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ], + "passes": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "'''Unit modifiers'''", + "'''Value classes'''", + "* testValueClass {allowedCharacter=?, allowedCharacter=letters}", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "'''Unit modifiers'''", + "'''Value classes'''", + "* testValueClass {allowedCharacter=letters}", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ] + } + } + } +] \ No newline at end of file diff --git a/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_CONVERSION_FACTOR.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_CONVERSION_FACTOR.json new file mode 100644 index 0000000..b1df253 --- /dev/null +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_CONVERSION_FACTOR.json @@ -0,0 +1,136 @@ +[ + { + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", + "name": "attribute-conversion-factor-invalid", + "warning": true, + "description": "A schema unit has an invalid conversion factor", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "* testUnitClass ", + "** testUnit1{SIUnit, conversionFactor=-1.0}", + "** testUnit2", + "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "* testUnitClass ", + "** testUnit1{SIUnit, conversionFactor=word}", + "** testUnit2", + "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "* testUnitClass ", + "** testUnit1{SIUnit, conversionFactor=None}", + "** testUnit2", + "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "* testUnitClass ", + "** testUnit1{SIUnit, conversionFactor}", + "** testUnit2", + "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ], + "passes": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "* testUnitClass {defaultUnits=testUnit1}", + "** testUnit1", + "** testUnit2", + "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ] + } + } + }, + { + "error_code": "WIKI_DELIMITERS_INVALID", + "name": "attribute-conversion-format", + "warning": true, + "description": "A schema unit has an invalid conversion factor due to bad formatting", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes''' ", + "* testUnitClass ", + "** testUnit1{SIUnit, conversionFactor=}", + "** testUnit2", + "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ], + "passes": [ + ] + } + } + } +] \ No newline at end of file diff --git a/tests/json_tests/SCHEMA_DEFAULT_UNITS_INVALID.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_DEFAULT_UNIT.json similarity index 71% rename from tests/json_tests/SCHEMA_DEFAULT_UNITS_INVALID.json rename to tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_DEFAULT_UNIT.json index 5f8aba8..3073456 100644 --- a/tests/json_tests/SCHEMA_DEFAULT_UNITS_INVALID.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_DEFAULT_UNIT.json @@ -1,6 +1,6 @@ [ { - "error_code": "SCHEMA_DEFAULT_UNITS_INVALID", + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "attribute-default-unit-invalid", "warning": true, "description": "A schema unit class has an invalid default value", @@ -11,6 +11,7 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "!# end schema", "'''Unit classes''' [Unit classes and the units for the nodes.]", @@ -18,12 +19,18 @@ "** testUnit1", "** testUnit2", "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "!# end schema", "'''Unit classes''' [Unit classes and the units for the nodes.]", @@ -31,6 +38,11 @@ "** testUnit1", "** testUnit2", "** testUnit3", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_DEPRECATED_INVALID.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_DEPRECATED.json similarity index 63% rename from tests/json_tests/SCHEMA_DEPRECATED_INVALID.json rename to tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_DEPRECATED.json index b66d3c0..aca6d19 100644 --- a/tests/json_tests/SCHEMA_DEPRECATED_INVALID.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_DEPRECATED.json @@ -1,6 +1,6 @@ [ { - "error_code": "SCHEMA_DEPRECATED_INVALID", + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "schema-deprecated-invalid", "warning": true, "description": "A schema deprecation issue, saying there is an invalid version", @@ -11,28 +11,42 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''BaseTag'''", "* Extension {deprecatedFrom=0.5.0}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''BaseTag'''", "* Extension {deprecatedFrom=1.0.0}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] } } }, - { - "error_code": "SCHEMA_DEPRECATED_INVALID", + { + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "schema-deprecated-invalid-child", "warning": true, "description": "A schema deprecation issue, saying there is an invalid child of a deprecated node", @@ -43,20 +57,34 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''BaseTag''' {deprecatedFrom=1.0.0}", "* Extension ", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''BaseTag''' {deprecatedFrom=1.0.0}", "* Extension {deprecatedFrom=1.0.0}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_IN_LIBRARY.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_IN_LIBRARY.json new file mode 100644 index 0000000..dfbb220 --- /dev/null +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_IN_LIBRARY.json @@ -0,0 +1,50 @@ +[ + { + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", + "name": "attribute-invalid-in-library", + "warning": true, + "description": "A schema unit has an invalid in library attribute(most other library errors are SCHEMA_LIBRARY_INVALID", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\" library=\"right\"", + "'''Prologue'''", + "!# start schema", + "'''Tag''' {inLibrary=wrong}", + "!# end schema", + "'''Unit classes''' ", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "* inLibrary {elementProperty}", + "'''Properties'''", + "* elementProperty", + "'''Epilogue'''", + "!# end hed" + ] + ], + "passes": [ + [ + "HED version=\"1.0.0\" library=\"right\"", + "'''Prologue'''", + "!# start schema", + "'''Tag''' {inLibrary=right}", + "!# end schema", + "'''Unit classes''' ", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "* inLibrary {elementProperty}", + "'''Properties'''", + "* elementProperty", + "'''Epilogue'''", + "!# end hed" + ] + ] + } + } + } +] \ No newline at end of file diff --git a/tests/json_tests/SCHEMA_NON_PLACEHOLDER_HAS_CLASS.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_NON_PLACEHOLDER_HAS_CLASS.json similarity index 55% rename from tests/json_tests/SCHEMA_NON_PLACEHOLDER_HAS_CLASS.json rename to tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_NON_PLACEHOLDER_HAS_CLASS.json index d879d03..34eaedf 100644 --- a/tests/json_tests/SCHEMA_NON_PLACEHOLDER_HAS_CLASS.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_NON_PLACEHOLDER_HAS_CLASS.json @@ -1,6 +1,6 @@ [ { - "error_code": "SCHEMA_NON_PLACEHOLDER_HAS_CLASS", + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "attribute-on-nonplaceholder-invalid", "warning": true, "description": "A non placeholder tag has takes value, unit class, or value class", @@ -11,33 +11,61 @@ "fails": [ [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''BaseTag''' {takesValue}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''BaseTag''' {valueClass=numericClass}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''BaseTag''' {unitClass=timeUnits}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''BaseTag''' {relatedTag=Event}", "* # {takesValue, unitClass=timeUnits, valueClass=numericClass}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_RELATED_TAG_INVALID.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_RELATED_TAG.json similarity index 57% rename from tests/json_tests/SCHEMA_RELATED_TAG_INVALID.json rename to tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_RELATED_TAG.json index 58f3604..4eef04c 100644 --- a/tests/json_tests/SCHEMA_RELATED_TAG_INVALID.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_RELATED_TAG.json @@ -1,6 +1,6 @@ [ { - "error_code": "SCHEMA_RELATED_TAG_INVALID", + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "attribute-relatedTag-invalid", "warning": true, "description": "A related tag points to an unknown tag", @@ -11,33 +11,61 @@ "fails": [ [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {relatedTag=invalid}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {relatedTag=Event, relatedTag=invalid}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {relatedTag=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {relatedTag=Event}", "* ExtendedTag {relatedTag=Tag-with-unknown, relatedTag=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_SUGGESTED_TAG_INVALID.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_SUGGESTED_TAG.json similarity index 57% rename from tests/json_tests/SCHEMA_SUGGESTED_TAG_INVALID.json rename to tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_SUGGESTED_TAG.json index f72069a..afc4b17 100644 --- a/tests/json_tests/SCHEMA_SUGGESTED_TAG_INVALID.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_SUGGESTED_TAG.json @@ -1,6 +1,6 @@ [ { - "error_code": "SCHEMA_SUGGESTED_TAG_INVALID", + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "attribute-suggestedTag-invalid", "warning": true, "description": "A suggested tag points to an unknown tag", @@ -11,33 +11,61 @@ "fails": [ [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {suggestedTag=invalid}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {suggestedTag=Event, suggestedTag=invalid}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {suggestedTag=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown''' {suggestedTag=Event}", "* ExtendedTag {suggestedTag=Tag-with-unknown, suggestedTag=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_UNIT_CLASS_INVALID.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_UNIT_CLASS.json similarity index 62% rename from tests/json_tests/SCHEMA_UNIT_CLASS_INVALID.json rename to tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_UNIT_CLASS.json index b50dee9..2462c6a 100644 --- a/tests/json_tests/SCHEMA_UNIT_CLASS_INVALID.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_UNIT_CLASS.json @@ -1,6 +1,6 @@ [ { - "error_code": "SCHEMA_UNIT_CLASS_INVALID", + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "attribute-invalid-unit-class", "warning": true, "description": "A schema unit class issue, saying there is an unknown one.", @@ -11,20 +11,34 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown'''", "* # {unitClass=unknown}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown'''", "* # {unitClass=timeUnits}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_VALUE_CLASS_INVALID.json b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_VALUE_CLASS.json similarity index 62% rename from tests/json_tests/SCHEMA_VALUE_CLASS_INVALID.json rename to tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_VALUE_CLASS.json index bce54a7..e55520f 100644 --- a/tests/json_tests/SCHEMA_VALUE_CLASS_INVALID.json +++ b/tests/json_tests/SCHEMA_ATTRIBUTE_VALUE_INVALID_VALUE_CLASS.json @@ -1,6 +1,6 @@ [ { - "error_code": "SCHEMA_VALUE_CLASS_INVALID", + "error_code": "SCHEMA_ATTRIBUTE_VALUE_INVALID", "name": "attribute-invalid-value-class", "warning": true, "description": "A schema value class issue, saying there is an unknown one.", @@ -11,20 +11,34 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown'''", "* # {valueClass=unknown}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''Tag-with-unknown'''", "* # {valueClass=numericClass}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_DUPLICATE_NODE.json b/tests/json_tests/SCHEMA_DUPLICATE_NODE.json new file mode 100644 index 0000000..9fa834a --- /dev/null +++ b/tests/json_tests/SCHEMA_DUPLICATE_NODE.json @@ -0,0 +1,141 @@ +[ + { + "error_code": "SCHEMA_DUPLICATE_NODE", + "name": "attribute-duplicate-node", + "warning": true, + "description": "A schema attribute issue, saying there is an unknown one.", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "* Tag", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers''' ", + "* mod1 ", + "'''Value classes'''", + "'''Schema attributes''' ", + "* unitAttribute ", + "'''Properties''' ", + "* unitProperty ", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers''' ", + "* mod1 ", + "* mod1 ", + "'''Value classes'''", + "'''Schema attributes''' ", + "* unitAttribute ", + "'''Properties''' ", + "* unitProperty ", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes''' ", + "* unitClass1 ", + "** unit1 ", + "** unit1 ", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes''' ", + "* unitAttribute ", + "'''Properties''' ", + "* unitProperty ", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes''' ", + "* unitClass1 ", + "** unit1 ", + "* unitClass2 ", + "** unit1 ", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes''' ", + "* unitAttribute ", + "'''Properties''' ", + "* unitProperty ", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes''' ", + "* unitAttribute ", + "* unitAttribute ", + "'''Properties''' ", + "* unitProperty ", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes''' ", + "* unitAttribute ", + "'''Properties''' ", + "* unitProperty ", + "* unitProperty ", + "'''Epilogue'''", + "!# end hed" + ] + ], + "passes": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "'''Tag-with-unknown''' {suggestedTag=Event}", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ] + } + } + } +] \ No newline at end of file diff --git a/tests/json_tests/SCHEMA_HEADER_INVALID.json b/tests/json_tests/SCHEMA_HEADER_INVALID.json new file mode 100644 index 0000000..72d9f25 --- /dev/null +++ b/tests/json_tests/SCHEMA_HEADER_INVALID.json @@ -0,0 +1,90 @@ +[ + { + "error_code": "SCHEMA_HEADER_INVALID", + "name": "schema-header-malformed-attribute", + "warning": true, + "description": "A schema attribute issue, saying there is an unknown one.", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\" unknownAttribute=other", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ], + "passes": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "'''Tag-with-unknown''' {suggestedTag=Event}", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ] + } + } + }, + { + "error_code": "SCHEMA_HEADER_INVALID", + "name": "schema-header-unknown-attribute", + "warning": true, + "description": "A schema attribute issue, saying there is an unknown one.", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\" unknownAttribute=\"other\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ], + "passes": [ + [ + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "'''Tag-with-unknown''' {suggestedTag=Event}", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ] + } + } + } +] \ No newline at end of file diff --git a/tests/json_tests/SCHEMA_LIBRARY_INVALID.json b/tests/json_tests/SCHEMA_LIBRARY_INVALID.json index 3f95264..ea0842f 100644 --- a/tests/json_tests/SCHEMA_LIBRARY_INVALID.json +++ b/tests/json_tests/SCHEMA_LIBRARY_INVALID.json @@ -10,20 +10,57 @@ "schema_tests": { "fails": [ [ - "HED version=\"1.0.0\" library=\"score_invalidchar\" withStandard=\"8.2.0\" unmerged=\"True\"" + "HED version=\"1.0.0\" library=\"score_invalidchar\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" ], [ - "HED version=\"1.0.0\" library=\"score1\" withStandard=\"8.2.0\" unmerged=\"True\"" + "HED version=\"1.0.0\" library=\"score1\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" ], [ - "HED version=\"1.0.0\" library=\"Score\" withStandard=\"8.2.0\" unmerged=\"True\"" + "HED version=\"1.0.0\" library=\"Score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] @@ -41,17 +78,44 @@ "schema_tests": { "fails": [ [ - "HED version=\"1.0.0\" withStandard=\"8.2.0\" unmerged=\"True\"" + "HED version=\"1.0.0\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" ], [ - "HED version=\"1.0.0\" withStandard=\"8.2.0\"" + "HED version=\"1.0.0\" withStandard=\"8.2.0\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] @@ -69,17 +133,44 @@ "schema_tests": { "fails": [ [ - "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.9.9\" unmerged=\"True\"" + "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.9.9\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" ], [ - "HED version=\"1.0.0\" library=\"score\" withStandard=\"7.9.9\" unmerged=\"True\"" + "HED version=\"1.0.0\" library=\"score\" withStandard=\"7.9.9\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] @@ -98,29 +189,48 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\"", + "'''Prologue'''", "!# start schema", "'''Event''' {rooted=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\"", + "'''Prologue'''", "!# start schema", "'''Event''' {rooted=Property}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", "'''Schema attributes'''", "* rooted {nodeProperty} ", "'''Properties'''", "* nodeProperty", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewThing''' {rooted=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] @@ -139,19 +249,33 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewNode'''", "* NewExtension {rooted=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewNode''' {rooted=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] @@ -170,26 +294,47 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''DummyTag'''", "'''NewTag'''{rooted=DummyTag}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ], [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''DummyTag'''{rooted=NotRealTag}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewTag''' {rooted=Event}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] @@ -208,20 +353,34 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewTag''' {rooted=Event}", - "* ExtendedEvent {inLibrary=\"score\"}", + "* ExtendedEvent {inLibrary=score}", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewTag''' {rooted=Event}", "* ExtendedEvent", "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] @@ -240,6 +399,7 @@ "fails": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewTag''' {rooted=Event}", "* ExtendedEvent", @@ -247,12 +407,18 @@ "'''Unit classes'''", "* weightUnits", "** g {SIUnit, unitSymbol, conversionFactor=1.0}", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ], "passes": [ [ "HED version=\"1.0.0\" library=\"score\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", "!# start schema", "'''NewTag''' {rooted=Event}", "* ExtendedEvent", @@ -260,6 +426,11 @@ "'''Unit classes'''", "* weightUnits", "** testNewUnit {conversionFactor=10.0}", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", "!# end hed" ] ] diff --git a/tests/json_tests/SCHEMA_SECTION_MISSING.json b/tests/json_tests/SCHEMA_SECTION_MISSING.json new file mode 100644 index 0000000..d3c27ab --- /dev/null +++ b/tests/json_tests/SCHEMA_SECTION_MISSING.json @@ -0,0 +1,149 @@ +[ + { + "error_code": "SCHEMA_SECTION_MISSING", + "name": "schema-section-missing", + "warning": true, + "description": "A schema attribute issue, saying there is an unknown one.", + "schema": "", + "definitions": [], + "tests": { + "schema_tests": { + "fails": [ + [ + "HED version=\"1.0.0\"", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Epilogue'''", + "!# end hed" + ], + [ + "HED version=\"1.0.0\"", + "'''Prologue'''", + "!# start schema", + "'''Tag'''", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''" + ] + ], + "passes": [ + [ + "HED version=\"1.0.0\" library=\"testlib\" withStandard=\"8.2.0\" unmerged=\"True\"", + "'''Prologue'''", + "!# start schema", + "'''Tag''' {suggestedTag=Tag}", + "!# end schema", + "'''Unit classes'''", + "'''Unit modifiers'''", + "'''Value classes'''", + "'''Schema attributes'''", + "'''Properties'''", + "'''Epilogue'''", + "!# end hed" + ] + ] + } + } + } +] \ No newline at end of file diff --git a/tests/json_tests/SIDECAR_BRACES_INVALID.json b/tests/json_tests/SIDECAR_BRACES_INVALID.json index bf19fa9..e6c2cf9 100644 --- a/tests/json_tests/SIDECAR_BRACES_INVALID.json +++ b/tests/json_tests/SIDECAR_BRACES_INVALID.json @@ -1,605 +1,605 @@ -[ - { - "error_code": "SIDECAR_BRACES_INVALID", - "name": "sidecar-braces-contents-invalid", - "description": "The item in curly braces is not the word HED or a column name with HED annotations in the sidecar.", - "schema": "8.1.0", - "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], - "tests": { - "string_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "sidecar_tests": { - "fails": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description but no HED" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_action": { - "Description": "Does not correspond to curly braces" - } - } - ], - "passes": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_action": { - "Description": "Does not correspond to curly braces" - } - } - ] - }, - "event_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "combo_tests": { - "fails": [ - ], - "passes": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - "events": - [ - ["onset", "duration", "event_code","HED", "response_time"], - [ 4.5, 0, "face", "Blue", 0], - [ 5.0, 0, "ball", "Green, Def/MyColor", 1], - [ 5.5, 0, "face", "", 2], - [ 5.7, 0, "face", "n/a", 3] - ] - } - ] - } - } - }, - { - "error_code": "VALUE_INVALID", - "name": "sidecar-braces-invalid-spot", - "description": "A curly brace reference must only appear where a tag could.", - "schema": "8.1.0", - "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], - "tests": { - "string_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "sidecar_tests": { - "fails": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "(Def/Acc/{response_time})" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - } - ], - "passes": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - } - ] - }, - "event_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "combo_tests": { - "fails": [ - ], - "passes": [ - ] - } - } - }, - { - "error_code": "SIDECAR_BRACES_INVALID", - "name": "sidecar-braces-circular-reference", - "description": "The item in curly braces has a HED annotation that contains curly braces.", - "schema": "8.2.0", - "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], - "tests": { - "string_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "sidecar_tests": { - "fails": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), {HED}", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "HED": "Label/#, {event_code}" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), {HED}", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)", - "dog": "Orange, {event_type}" - } - }, - "response_time": { - "HED": "Label/#" - }, - "event_type": { - "HED": { - "banana": "Blue, {response_time}", - "apple": "Green" - } - } - } - ], - "passes": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - }, - "response_count": { - "Description": "A count used to test curly braces in value columns.", - "HED": "(Item-count/#, {response_time})" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" - } - }, - "response_action": { - "Description": "Does not correspond to curly braces", - "HED": "Label/#" - } - } - ] - }, - "event_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "combo_tests": { - "fails": [ - ], - "passes": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - "events": - [ - ["onset", "duration", "response_time", "event_code","HED"], - [ 4.5, 0, 3.4, "face", "Blue"], - [ 5.0, 0, 6.8, "ball", "Green, Def/MyColor"], - [ 5.2, 0, "n/a", "face", ""], - [ 5.5, 0, "any", "face", "n/a"] - ] - } - ] - } - } - }, - { - "error_code": "SIDECAR_BRACES_INVALID", - "name": "sidecar-braces-self-reference", - "description": "The item in curly braces has a HED annotation that contains itself.", - "schema": "8.2.0", - "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], - "tests": { - "string_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "sidecar_tests": { - "fails": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), {HED}", - "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "HED": "Label/#, {response_time}" - } - } - ], - "passes": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - }, - "response_count": { - "Description": "A count used to test curly braces in value columns.", - "HED": "(Item-count/#, {response_time})" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" - } - }, - "response_action": { - "Description": "Does not correspond to curly braces", - "HED": "Label/#" - } - } - ] - }, - "event_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "combo_tests": { - "fails": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#, {response_time}" - } - }, - "events": - [ - ["onset", "duration", "response_time", "event_code","HED"], - [ 4.5, 0, 3.4, "face", "Blue"], - [ 5.0, 0, 6.8, "ball", "Green, Def/MyColor"], - [ 5.2, 0, "n/a", "face", ""], - [ 5.5, 0, "any", "face", "n/a"] - ] - } - ], - "passes": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - "events": - [ - ["onset", "duration", "response_time", "event_code","HED"], - [ 4.5, 0, 3.4, "face", "Blue"], - [ 5.0, 0, 6.8, "ball", "Green, Def/MyColor"], - [ 5.2, 0, "n/a", "face", ""], - [ 5.5, 0, "any", "face", "n/a"] - ] - } - ] - } - } - }, - { - "error_code": "SIDECAR_BRACES_INVALID", - "name": "sidecar-braces-nested-or-mismatched", - "description": "The curly braces in the sidecar are mismatched or nested.", - "schema": "8.1.0", - "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], - "tests": { - "string_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "sidecar_tests": { - "fails": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{response_time}{, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description but no HED", - "HED": "Label/#" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description but no HED", - "HED": "Label/#" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "{{response_time}}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description but no HED", - "HED": "Label/#" - } - } - ], - "passes": [ - { - "event_code": { - "HED": { - "face": "(Red, Blue), ({response_time}, (Green, (Yellow)))", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow))", - "ball": "({HED}, (Def/Acc/3.5 m-per-s^2))" - } - }, - "response_action": { - "Description": "Does not correspond to curly braces" - } - } - ] - }, - "event_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "combo_tests": { - "fails": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - "events": - [ - ["onset", "duration", "event_code","HED"], - [ 4.5, 0, "face", "Blue"], - [ 5.0, 0, "ball", "Green, Def/MyColor"], - [ 5.2, 0, "face", ""], - [ 5.5, 0, "face", "n/a"] - ] - } - ], - "passes": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - "events": - [ - ["onset", "duration", "event_code","HED", "response_time"], - [ 4.5, 0, "face", "Blue", 1], - [ 5.0, 0, "ball", "Green, Def/MyColor", 1], - [ 5.2, 0, "face", "", 1], - [ 5.5, 0, "face", "n/a", 1] - ] - } - ] - } - } - }, - { - "error_code": "INVALID_CHARACTER", - "name": "sidecar-braces-in-events-file", - "description": "The curly braces in the sidecar are mismatched or nested.", - "schema": "8.1.0", - "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], - "tests": { - "string_tests": { - "fails": [ - "{HED}, Def/MyColor" - ], - "passes": [ - ] - }, - "sidecar_tests": { - "fails": [ - ], - "passes": [ - ] - }, - "event_tests": { - "fails": [ - [ - ["onset", "duration", "HED"], - [ 4.5, 0, "{who_knows}, Red"] - ] - ], - "passes": [ - ] - }, - "combo_tests": { - "fails": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - "events": - [ - ["onset", "duration", "event_code","HED"], - [ 4.5, 0, "face", "Blue, {response_time}"], - [ 5.0, 0, "ball", "Green, Def/MyColor"], - [ 5.2, 0, "face", ""], - [ 5.5, 0, "face", "n/a"] - ] - } - ], - "passes": [ - { - "sidecar": { - "event_code": { - "HED": { - "face": "(Red, Blue), (Green, (Yellow)), ({HED})", - "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" - } - }, - "response_time": { - "Description": "Has description with HED", - "HED": "Label/#" - } - }, - "events": - [ - ["onset", "duration", "event_code","HED", "response_time"], - [ 4.5, 0, "face", "Blue", 1], - [ 5.0, 0, "ball", "Green, Def/MyColor", 1], - [ 5.2, 0, "face", "", 1], - [ 5.5, 0, "face", "n/a", 1] - ] - } - ] - } - } - } -] +[ + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-contents-invalid", + "description": "The item in curly braces is not the word HED or a column name with HED annotations in the sidecar.", + "schema": "8.1.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description but no HED" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces" + } + } + ] + }, + "event_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "combo_tests": { + "fails": [ + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": + [ + ["onset", "duration", "event_code","HED", "response_time"], + [ 4.5, 0, "face", "Blue", 0], + [ 5.0, 0, "ball", "Green, Def/MyColor", 1], + [ 5.5, 0, "face", "", 2], + [ 5.7, 0, "face", "n/a", 3] + ] + } + ] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "sidecar-braces-invalid-spot", + "description": "A curly brace reference must only appear where a tag could.", + "schema": "8.1.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/Acc/{response_time})" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "combo_tests": { + "fails": [ + ], + "passes": [ + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-circular-reference", + "description": "The item in curly braces has a HED annotation that contains curly braces.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {event_code}" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)", + "dog": "Orange, {event_type}" + } + }, + "response_time": { + "HED": "Label/#" + }, + "event_type": { + "HED": { + "banana": "Blue, {response_time}", + "apple": "Green" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "combo_tests": { + "fails": [ + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": + [ + ["onset", "duration", "response_time", "event_code","HED"], + [ 4.5, 0, 3.4, "face", "Blue"], + [ 5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [ 5.2, 0, "n/a", "face", ""], + [ 5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-self-reference", + "description": "The item in curly braces has a HED annotation that contains itself.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {response_time}" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#, {response_time}" + } + }, + "events": + [ + ["onset", "duration", "response_time", "event_code","HED"], + [ 4.5, 0, 3.4, "face", "Blue"], + [ 5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [ 5.2, 0, "n/a", "face", ""], + [ 5.5, 0, "any", "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": + [ + ["onset", "duration", "response_time", "event_code","HED"], + [ 4.5, 0, 3.4, "face", "Blue"], + [ 5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [ 5.2, 0, "n/a", "face", ""], + [ 5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-nested-or-mismatched", + "description": "The curly braces in the sidecar are mismatched or nested.", + "schema": "8.1.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}{, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description but no HED", + "HED": "Label/#" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description but no HED", + "HED": "Label/#" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{{response_time}}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description but no HED", + "HED": "Label/#" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), ({response_time}, (Green, (Yellow)))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "({HED}, (Def/Acc/3.5 m-per-s^2))" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces" + } + } + ] + }, + "event_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": + [ + ["onset", "duration", "event_code","HED"], + [ 4.5, 0, "face", "Blue"], + [ 5.0, 0, "ball", "Green, Def/MyColor"], + [ 5.2, 0, "face", ""], + [ 5.5, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": + [ + ["onset", "duration", "event_code","HED", "response_time"], + [ 4.5, 0, "face", "Blue", 1], + [ 5.0, 0, "ball", "Green, Def/MyColor", 1], + [ 5.2, 0, "face", "", 1], + [ 5.5, 0, "face", "n/a", 1] + ] + } + ] + } + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "sidecar-braces-in-events-file", + "description": "The curly braces in the sidecar are mismatched or nested.", + "schema": "8.1.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "{HED}, Def/MyColor" + ], + "passes": [ + ] + }, + "sidecar_tests": { + "fails": [ + ], + "passes": [ + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [ 4.5, 0, "{who_knows}, Red"] + ] + ], + "passes": [ + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": + [ + ["onset", "duration", "event_code","HED"], + [ 4.5, 0, "face", "Blue, {response_time}"], + [ 5.0, 0, "ball", "Green, Def/MyColor"], + [ 5.2, 0, "face", ""], + [ 5.5, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": + [ + ["onset", "duration", "event_code","HED", "response_time"], + [ 4.5, 0, "face", "Blue", 1], + [ 5.0, 0, "ball", "Green, Def/MyColor", 1], + [ 5.2, 0, "face", "", 1], + [ 5.5, 0, "face", "n/a", 1] + ] + } + ] + } + } + } +]