Skip to content

Commit

Permalink
Merge pull request #194 from hed-standard/fix-tag-group-equivalence
Browse files Browse the repository at this point in the history
Fix bug with tag group equivalence that was causing tests to fail
  • Loading branch information
VisLab authored Sep 14, 2024
2 parents db0b4ae + 0037c24 commit ae7c2ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bids/validator/bidsHedTsvValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 5 additions & 1 deletion parser/parsedHedGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion spec_tests/jsonTests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit ae7c2ff

Please sign in to comment.