@@ -42,29 +42,37 @@ describe('TSV', function(){
4242 } ;
4343
4444 it ( 'should require events files to have "onset" as first header' , function ( ) {
45- var tsv = 'header-one\tduration\t4eader -three\n' +
45+ var tsv = 'header-one\tduration\theader -three\n' +
4646 'value-one\tvalue-two\tvalue-three' ;
4747 validate . TSV . TSV ( eventsFile , tsv , [ ] , function ( issues ) {
4848 assert ( issues . length === 1 && issues [ 0 ] . code === 20 ) ;
4949 } ) ;
5050 } ) ;
5151
5252 it ( 'should require events files to have "duration" as second header' , function ( ) {
53- var tsv = 'onset\theader-two\t4eader -three\n' +
53+ var tsv = 'onset\theader-two\theader -three\n' +
5454 'value-one\tvalue-two\tvalue-three' ;
5555 validate . TSV . TSV ( eventsFile , tsv , [ ] , function ( issues ) {
5656 assert ( issues . length === 1 && issues [ 0 ] . code === 21 ) ;
5757 } ) ;
5858 } ) ;
5959
6060 it ( 'should not throw issues for a valid events file' , function ( ) {
61- var tsv = 'onset\tduration\t4eader -three\n' +
61+ var tsv = 'onset\tduration\theader -three\n' +
6262 'value-one\tvalue-two\tvalue-three' ;
6363 validate . TSV . TSV ( eventsFile , tsv , [ ] , function ( issues ) {
6464 assert . deepEqual ( issues , [ ] ) ;
6565 } ) ;
6666 } ) ;
6767
68+ it ( 'should not throw issues for a valid events file with only two columns' , function ( ) {
69+ var tsv = 'onset\tduration\n' +
70+ 'value-one\tvalue-two' ;
71+ validate . TSV . TSV ( eventsFile , tsv , [ ] , function ( issues ) {
72+ assert . deepEqual ( issues , [ ] ) ;
73+ } ) ;
74+ } ) ;
75+
6876 it ( 'should check for the presence of any stimulus files declared' , function ( ) {
6977 var tsv = 'onset\tduration\tstim_file\n' +
7078 'value-one\tvalue-two\timages/red-square.jpg' ;
@@ -87,15 +95,15 @@ describe('TSV', function(){
8795 } ;
8896
8997 it ( "should not allow participants.tsv files without participant_id columns" , function ( ) {
90- var tsv = 'subject_id\theader-two\t4eader -three\n' +
98+ var tsv = 'subject_id\theader-two\theader -three\n' +
9199 'value-one\tvalue-two\tvalue-three' ;
92100 validate . TSV . TSV ( participantsFile , tsv , [ ] , function ( issues ) {
93101 assert ( issues . length === 1 && issues [ 0 ] . code === 48 ) ;
94102 } ) ;
95103 } ) ;
96104
97105 it ( "should allow a valid participants.tsv file" , function ( ) {
98- var tsv = 'participant_id\theader-two\t4eader -three\n' +
106+ var tsv = 'participant_id\theader-two\theader -three\n' +
99107 'value-one\tvalue-two\tvalue-three' ;
100108 validate . TSV . TSV ( participantsFile , tsv , [ ] , function ( issues ) {
101109 assert . deepEqual ( issues , [ ] ) ;
0 commit comments