From 46c57e94b9ee633af4bb44cc7cee2e169f7c8d2e Mon Sep 17 00:00:00 2001 From: Kay Robbins <1189050+VisLab@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:47:24 -0500 Subject: [PATCH] Minor changes to tests --- tests/javascript_tests.json | 104 ++++++++++-------- tests/json_tests/DEFINITION_INVALID.json | 11 +- .../json_tests/TEMPORAL_TAG_ERROR_DELAY.json | 53 ++++++--- tests/python_tests.json | 104 ++++++++++-------- 4 files changed, 162 insertions(+), 110 deletions(-) diff --git a/tests/javascript_tests.json b/tests/javascript_tests.json index c10c22b..af41143 100644 --- a/tests/javascript_tests.json +++ b/tests/javascript_tests.json @@ -868,7 +868,9 @@ "def2": "(Definition/Blech/#, ())" } } - }, + } + ], + "passes": [ { "defs": { "HED": { @@ -876,8 +878,7 @@ } } } - ], - "passes": [] + ] }, "event_tests": { "fails": [], @@ -889,7 +890,6 @@ "sidecar": { "defs": { "HED": { - "def1": "(Definition/Apple), ((Definition/Blech, (Red)))", "def2": "(Definition/Blech/#, ())" } } @@ -937,7 +937,9 @@ }, { "error_code": "DEFINITION_INVALID", - "alt_codes": [], + "alt_codes": [ + "TAG_GROUP_ERROR" + ], "name": "definition-invalid-multiple-definition-tags", "description": "A definition's enclosing tag group contains more than a `Definition` tag and an inner group.", "warning": false, @@ -1033,7 +1035,9 @@ }, { "error_code": "DEFINITION_INVALID", - "alt_codes": [], + "alt_codes": [ + "TAG_GROUP_ERROR" + ], "name": "definition-invalid-inner-group-defs", "description": "A definition's inner tag group contains `Definition`, `Def` or `Def-expand` tags.", "warning": false, @@ -9716,13 +9720,21 @@ "ball": "Delay/5.0 s, Def/Acc/5.4 m-per-s^2" } } + }, + { + "event_code": { + "HED": { + "face": "Blue, Red", + "ball": "Delay/5.0 s, (Def/Acc/5.4 m-per-s^2)" + } + } } ], "passes": [ { "event_code": { "HED": { - "face": "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)" + "face": "(Delay/5.0 s, (Def/Acc/5.4 m-per-s^2))" } } } @@ -9737,19 +9749,21 @@ "HED" ], [ - 4.5, + 5.0, 0, - "Delay/1.0 s, Onset, Red" - ], + "Delay/1.0 s, Red" + ] + ], + [ [ - 4.8, - 0, - "(Onset, MyColor)" + "onset", + "duration", + "HED" ], [ - 5.0, + 4.5, 0, - "Delay/1.0 s, Offset, MyColor" + "Delay/1.0 s, (Red))" ] ] ], @@ -9763,17 +9777,7 @@ [ 4.5, 0, - "(Delay/5.0 s, Onset, (Def-expand/MyColor, (Label/Pie)), (Red))" - ], - [ - 5.5, - 0, - "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)" - ], - [ - 6.3, - 0, - "(Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2)" + "(Delay/5.0 s, (Red))" ] ] ] @@ -9784,8 +9788,8 @@ "sidecar": { "event_code": { "HED": { - "face": "Onset, Red", - "ball": "Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2" + "face": "Red", + "ball": "Delay/5.0 s, Def/Acc/5.4 m-per-s^2" } } }, @@ -9800,29 +9804,28 @@ 4.5, 0, "ball", - "Onset, Red" + "Red" ], [ 4.8, 0, "n/a", - "(Onset/MyColor)" + "Blue" ], [ 5.0, 0, "face", - "Offset, MyColor" + "Green" ] ] - } - ], - "passes": [ + }, { "sidecar": { "event_code": { "HED": { - "face": "(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" + "face": "Red", + "ball": "Delay/5.0 s, (Def/Acc/5.4 m-per-s^2)" } } }, @@ -9834,16 +9837,29 @@ "HED" ], [ - 5.5, + 4.5, 0, - "n/a", - "(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" - ], + "ball", + "Red" + ] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, (Def/Acc/5.4 m-per-s^2))" + } + } + }, + "events": [ [ - 6.3, - 0, - "n/a", - "(Offset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" + "onset", + "duration", + "event_code", + "HED" ], [ 8.5, @@ -9855,7 +9871,7 @@ 9.0, 0, "n/a", - "Green, (Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)" + "Green, (Delay/5.0 s, (Def/MyColor))" ] ] } diff --git a/tests/json_tests/DEFINITION_INVALID.json b/tests/json_tests/DEFINITION_INVALID.json index 9b52c48..5be1aa3 100644 --- a/tests/json_tests/DEFINITION_INVALID.json +++ b/tests/json_tests/DEFINITION_INVALID.json @@ -104,7 +104,9 @@ "def2": "(Definition/Blech/#, ())" } } - }, + } + ], + "passes": [ { "defs": { "HED": { @@ -112,8 +114,6 @@ } } } - ], - "passes": [ ] }, "event_tests": { @@ -128,7 +128,6 @@ "sidecar": { "defs": { "HED": { - "def1": "(Definition/Apple), ((Definition/Blech, (Red)))", "def2": "(Definition/Blech/#, ())" } } @@ -162,7 +161,7 @@ }, { "error_code": "DEFINITION_INVALID", - "alt_codes": [], + "alt_codes": ["TAG_GROUP_ERROR"], "name": "definition-invalid-multiple-definition-tags", "description": "A definition's enclosing tag group contains more than a `Definition` tag and an inner group.", "warning": false, @@ -245,7 +244,7 @@ }, { "error_code": "DEFINITION_INVALID", - "alt_codes": [], + "alt_codes": ["TAG_GROUP_ERROR"], "name": "definition-invalid-inner-group-defs", "description": "A definition's inner tag group contains `Definition`, `Def` or `Def-expand` tags.", "warning": false, diff --git a/tests/json_tests/TEMPORAL_TAG_ERROR_DELAY.json b/tests/json_tests/TEMPORAL_TAG_ERROR_DELAY.json index 42466ec..0fd6ff0 100644 --- a/tests/json_tests/TEMPORAL_TAG_ERROR_DELAY.json +++ b/tests/json_tests/TEMPORAL_TAG_ERROR_DELAY.json @@ -26,13 +26,21 @@ "ball": "Delay/5.0 s, Def/Acc/5.4 m-per-s^2" } } + }, + { + "event_code": { + "HED": { + "face": "Blue, Red", + "ball": "Delay/5.0 s, (Def/Acc/5.4 m-per-s^2)" + } + } } ], "passes": [ { "event_code": { "HED": { - "face": "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)" + "face": "(Delay/5.0 s, (Def/Acc/5.4 m-per-s^2))" } } } @@ -42,17 +50,17 @@ "fails": [ [ ["onset", "duration", "HED"], - [ 4.5, 0, "Delay/1.0 s, Onset, Red"], - [ 4.8, 0, "(Onset, MyColor)"], - [ 5.0, 0, "Delay/1.0 s, Offset, MyColor"] + [ 5.0, 0, "Delay/1.0 s, Red"] + ], + [ + ["onset", "duration", "HED"], + [ 4.5, 0, "Delay/1.0 s, (Red))"] ] ], "passes": [ [ ["onset", "duration", "HED"], - [ 4.5, 0, "(Delay/5.0 s, Onset, (Def-expand/MyColor, (Label/Pie)), (Red))"], - [ 5.5, 0, "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)"], - [ 6.3, 0, "(Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2)"] + [ 4.5, 0, "(Delay/5.0 s, (Red))"] ] ] }, @@ -62,17 +70,32 @@ "sidecar": { "event_code": { "HED": { - "face": "Onset, Red", - "ball": "Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2" + "face": "Red", + "ball": "Delay/5.0 s, Def/Acc/5.4 m-per-s^2" + } + } + }, + "events": + [ + ["onset", "duration", "event_code", "HED"], + [ 4.5, 0, "ball", "Red"], + [ 4.8, 0, "n/a", "Blue"], + [ 5.0, 0, "face", "Green"] + ] + }, + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red", + "ball": "Delay/5.0 s, (Def/Acc/5.4 m-per-s^2)" } } }, "events": [ ["onset", "duration", "event_code", "HED"], - [ 4.5, 0, "ball", "Onset, Red"], - [ 4.8, 0, "n/a", "(Onset/MyColor)"], - [ 5.0, 0, "face", "Offset, MyColor"] + [ 4.5, 0, "ball", "Red"] ] } ], @@ -81,17 +104,15 @@ "sidecar": { "event_code": { "HED": { - "face": "(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" + "face": "(Delay/5.0 s, (Def/Acc/5.4 m-per-s^2))" } } }, "events": [ ["onset", "duration", "event_code", "HED"], - [ 5.5, 0, "n/a","(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)"], - [ 6.3, 0, "n/a","(Offset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)"], [ 8.5, 0, "face", "Blue"], - [ 9.0, 0, "n/a", "Green, (Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)"] + [ 9.0, 0, "n/a", "Green, (Delay/5.0 s, (Def/MyColor))"] ] } ] diff --git a/tests/python_tests.json b/tests/python_tests.json index cc9fe45..b0cfa7e 100644 --- a/tests/python_tests.json +++ b/tests/python_tests.json @@ -868,7 +868,9 @@ "def2": "(Definition/Blech/#, ())" } } - }, + } + ], + "passes": [ { "defs": { "HED": { @@ -876,8 +878,7 @@ } } } - ], - "passes": [] + ] }, "event_tests": { "fails": [], @@ -889,7 +890,6 @@ "sidecar": { "defs": { "HED": { - "def1": "(Definition/Apple), ((Definition/Blech, (Red)))", "def2": "(Definition/Blech/#, ())" } } @@ -937,7 +937,9 @@ }, { "error_code": "DEFINITION_INVALID", - "alt_codes": [], + "alt_codes": [ + "TAG_GROUP_ERROR" + ], "name": "definition-invalid-multiple-definition-tags", "description": "A definition's enclosing tag group contains more than a `Definition` tag and an inner group.", "warning": false, @@ -1033,7 +1035,9 @@ }, { "error_code": "DEFINITION_INVALID", - "alt_codes": [], + "alt_codes": [ + "TAG_GROUP_ERROR" + ], "name": "definition-invalid-inner-group-defs", "description": "A definition's inner tag group contains `Definition`, `Def` or `Def-expand` tags.", "warning": false, @@ -12851,13 +12855,21 @@ "ball": "Delay/5.0 s, Def/Acc/5.4 m-per-s^2" } } + }, + { + "event_code": { + "HED": { + "face": "Blue, Red", + "ball": "Delay/5.0 s, (Def/Acc/5.4 m-per-s^2)" + } + } } ], "passes": [ { "event_code": { "HED": { - "face": "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)" + "face": "(Delay/5.0 s, (Def/Acc/5.4 m-per-s^2))" } } } @@ -12872,19 +12884,21 @@ "HED" ], [ - 4.5, + 5.0, 0, - "Delay/1.0 s, Onset, Red" - ], + "Delay/1.0 s, Red" + ] + ], + [ [ - 4.8, - 0, - "(Onset, MyColor)" + "onset", + "duration", + "HED" ], [ - 5.0, + 4.5, 0, - "Delay/1.0 s, Offset, MyColor" + "Delay/1.0 s, (Red))" ] ] ], @@ -12898,17 +12912,7 @@ [ 4.5, 0, - "(Delay/5.0 s, Onset, (Def-expand/MyColor, (Label/Pie)), (Red))" - ], - [ - 5.5, - 0, - "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)" - ], - [ - 6.3, - 0, - "(Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2)" + "(Delay/5.0 s, (Red))" ] ] ] @@ -12919,8 +12923,8 @@ "sidecar": { "event_code": { "HED": { - "face": "Onset, Red", - "ball": "Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2" + "face": "Red", + "ball": "Delay/5.0 s, Def/Acc/5.4 m-per-s^2" } } }, @@ -12935,29 +12939,28 @@ 4.5, 0, "ball", - "Onset, Red" + "Red" ], [ 4.8, 0, "n/a", - "(Onset/MyColor)" + "Blue" ], [ 5.0, 0, "face", - "Offset, MyColor" + "Green" ] ] - } - ], - "passes": [ + }, { "sidecar": { "event_code": { "HED": { - "face": "(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" + "face": "Red", + "ball": "Delay/5.0 s, (Def/Acc/5.4 m-per-s^2)" } } }, @@ -12969,16 +12972,29 @@ "HED" ], [ - 5.5, + 4.5, 0, - "n/a", - "(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" - ], + "ball", + "Red" + ] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, (Def/Acc/5.4 m-per-s^2))" + } + } + }, + "events": [ [ - 6.3, - 0, - "n/a", - "(Offset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" + "onset", + "duration", + "event_code", + "HED" ], [ 8.5, @@ -12990,7 +13006,7 @@ 9.0, 0, "n/a", - "Green, (Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)" + "Green, (Delay/5.0 s, (Def/MyColor))" ] ] }