From c68bdd6f5b5856b13b88ee3eebf8486d23f1f73e Mon Sep 17 00:00:00 2001 From: Alexander Jones Date: Fri, 13 Sep 2024 18:16:42 -0500 Subject: [PATCH 1/2] Fix bug with tag group equivalence that was causing tests to fail Also delete semicolon from commented-out auxiliary spec file line. --- parser/parsedHedGroup.js | 6 +++++- spec_tests/jsonTests.spec.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/parser/parsedHedGroup.js b/parser/parsedHedGroup.js index a66f1945..969fecf2 100644 --- a/parser/parsedHedGroup.js +++ b/parser/parsedHedGroup.js @@ -451,7 +451,11 @@ export class ParsedHedGroup extends ParsedHedSubstring { if (!(other instanceof ParsedHedGroup)) { return false } - return differenceWith(this.tags, other.tags, (ours, theirs) => ours.equivalent(theirs)).length === 0 + const equivalence = (ours, theirs) => ours.equivalent(theirs) + return ( + differenceWith(this.tags, other.tags, equivalence).length === 0 && + differenceWith(other.tags, this.tags, equivalence).length === 0 + ) } /** diff --git a/spec_tests/jsonTests.spec.js b/spec_tests/jsonTests.spec.js index 277484aa..14eae138 100644 --- a/spec_tests/jsonTests.spec.js +++ b/spec_tests/jsonTests.spec.js @@ -21,7 +21,7 @@ const skippedErrors = { } const readFileSync = fs.readFileSync const test_file_name = 'javascript_tests.json' -//const test_file_name = 'temp3.json'; +//const test_file_name = 'temp3.json' function comboListToStrings(items) { const comboItems = [] From 0037c24552eed50efb7dbf866c466e0d9772a61a Mon Sep 17 00:00:00 2001 From: Alexander Jones Date: Fri, 13 Sep 2024 18:40:42 -0500 Subject: [PATCH 2/2] Delete column splices when cell value is blank --- bids/validator/bidsHedTsvValidator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids/validator/bidsHedTsvValidator.js b/bids/validator/bidsHedTsvValidator.js index cf616e9e..6ecf52d2 100644 --- a/bids/validator/bidsHedTsvValidator.js +++ b/bids/validator/bidsHedTsvValidator.js @@ -322,7 +322,7 @@ export class BidsHedTsvParser { const columnSpliceMapping = new Map() for (const [columnName, columnValue] of rowCells.entries()) { - if (columnValue === 'n/a') { + if (columnValue === 'n/a' || columnValue === '') { columnSpliceMapping.set(columnName, null) continue }