Skip to content

Commit

Permalink
start missing columns with just X and test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Graul committed Jun 11, 2012
1 parent 06a8860 commit 82951ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/parsers/delimited.js
Expand Up @@ -187,7 +187,7 @@

//No column name? Create one starting with X
if ( _.isUndefined(strMatchedValue) || strMatchedValue === '' ) {
strMatchedValue = createColumnName('X');
strMatchedValue = 'X';
}

//Duplicate column name? Create a new one starting with the name
Expand Down
26 changes: 13 additions & 13 deletions test/unit/bugs.js
Expand Up @@ -107,8 +107,8 @@

ds.fetch({ success: function() {
equals(this._columns.length, 5);
ok( this._column('B') );
ok( this._column('B0') );
ok( this._columns[2].name === 'B' );
ok( this._columns[4].name === 'B0' );
}});

});
Expand All @@ -125,12 +125,12 @@

ds.fetch({ success: function() {
equals(this._columns.length, 7);
ok( this._column('B') );
ok( this._column('B0') );
ok( this._column('A') );
ok( this._column('A0') );
ok( this._column('X0') );
ok( this._column('X1') );
ok( this._columns[1].name === 'A' );
ok( this._columns[2].name === 'A0' );
ok( this._columns[3].name === 'B' );
ok( this._columns[4].name === 'B0' );
ok( this._columns[5].name === 'X' );
ok( this._columns[6].name === 'X0' );
}});

});
Expand All @@ -146,9 +146,9 @@

ds.fetch({ success: function() {
equals(this._columns.length, 5);
ok( this._column('X0') );
ok( this._column('X1') );
}});
ok( this._columns[2].name === 'X' );
ok( this._columns[3].name === 'X0' );
}});

});

Expand All @@ -163,8 +163,8 @@

ds.fetch({ success: function() {
equals(this._columns.length, 5);
ok( this._column('X0') );
ok( this._column('X1') );
ok( this._columns[2].name === 'X' );
ok( this._columns[3].name === 'X0' );
}});

});
Expand Down

0 comments on commit 82951ee

Please sign in to comment.