Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with tag group equivalence that was causing tests to fail #194

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading