Skip to content

Commit

Permalink
Preparo para testear #23
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoefe committed Nov 7, 2016
1 parent 230c77e commit 08e42b8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/txt-to-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ function initializeStats(info) {
}

function finalizeStats(info) {
info.stats.rows = info.rows.length;
info.stats.columns = info.columnsInfo.length;
return info;
}

Expand Down
1 change: 0 additions & 1 deletion test/fixtures/pk-complex-nn2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ text-field;int-field;num-field;big;double
hello;1;3.1;1234567890;1.12e-101
ciao;1;3.2;1234567890;1.12e-101
ciao;1;3.1;1234567890;1.12e-101

5 changes: 5 additions & 0 deletions test/fixtures/pk-custom.result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ opts:
maxScale: null
hasNullValues: false
hasCientificNotation: null
stats:
rows: 3
columns: 4
#numericColumns: 0
#nullColumns: 0
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ describe("fixtures", function(){
expect(differences(generated.rawSql,expected.rawSql)).to.eql(null);
// coherencia entre prepared y generated
expect(generated.errors).to.eql(prepared.errors);
if(expected.stats) { expect(generated.stats).to.eql(expected.stats); }
}).then(done,done);
});
}
Expand Down
2 changes: 2 additions & 0 deletions web/txt-to-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ function initializeStats(info) {
}

function finalizeStats(info) {
info.stats.rows = info.rows.length;
info.stats.columns = info.columnsInfo.length;
return info;
}

Expand Down

0 comments on commit 08e42b8

Please sign in to comment.