Skip to content

Commit 9c3baf3

Browse files
authored
Merge pull request #1435 from bids-standard/CHANNELS_COLUMN_TYPE-fix
fix: Provide evidence strings for Issues 130 and 131
2 parents da94aa9 + b837c8f commit 9c3baf3

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

bids-validator/tests/tsv.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,26 @@ describe('TSV', function() {
527527
})
528528
})
529529

530+
it('should return a string value for evidence for issue 130', function() {
531+
const tsv =
532+
'name\ttype\tunits\tlow_cutoff\thigh_cutoff\tstatus\n' +
533+
'value-name\teeg\tmV\tvalue-lowcut\tvalue-highcut\tgood'
534+
validate.TSV.TSV(channelsFileEEG, tsv, [], function(issues) {
535+
assert(issues.length === 1 && issues[0].code === 130)
536+
expect(typeof issues[0].evidence).toBe('string')
537+
})
538+
})
539+
540+
it('should return a string value for evidence for issue 131', function() {
541+
const tsv =
542+
'name\ttype\tunits\tlow_cutoff\thigh_cutoff\tstatus\n' +
543+
'value-name\tMEEG\tmV\tvalue-lowcut\tvalue-highcut\tgood'
544+
validate.TSV.TSV(channelsFileIEEG, tsv, [], function(issues) {
545+
assert(issues.length === 1 && issues[0].code === 131)
546+
expect(typeof issues[0].evidence).toBe('string')
547+
})
548+
})
549+
530550
it('should not allow EEG channels.tsv files with value other than accepted values in type column', function() {
531551
var tsv =
532552
'name\ttype\tunits\tlow_cutoff\thigh_cutoff\tstatus\n' +

bids-validator/validators/tsv/checkTypeCol.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const checkTypeCol = function(rows, file, issues) {
7777
issues.push(
7878
new Issue({
7979
file: file,
80-
evidence: line,
80+
evidence: line.join(', '),
8181
line: i + 1,
8282
reason:
8383
'the type column values should only consist of values specified for *_channels.tsv file',
@@ -89,7 +89,7 @@ const checkTypeCol = function(rows, file, issues) {
8989
issues.push(
9090
new Issue({
9191
file: file,
92-
evidence: line,
92+
evidence: line.join(', '),
9393
line: i + 1,
9494
reason: 'the type column values upper-cased',
9595
code: 130,

0 commit comments

Comments
 (0)