From 08e42b87cb445f263a76eaf63371272df7117c09 Mon Sep 17 00:00:00 2001 From: "Diego F.(EW7)" Date: Mon, 7 Nov 2016 14:40:08 -0300 Subject: [PATCH] Preparo para testear #23 --- lib/txt-to-sql.js | 2 ++ test/fixtures/pk-complex-nn2.txt | 1 - test/fixtures/pk-custom.result.yaml | 5 +++++ test/test.js | 1 + web/txt-to-sql.js | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/txt-to-sql.js b/lib/txt-to-sql.js index 9e9c47f..e75a0a0 100644 --- a/lib/txt-to-sql.js +++ b/lib/txt-to-sql.js @@ -663,6 +663,8 @@ function initializeStats(info) { } function finalizeStats(info) { + info.stats.rows = info.rows.length; + info.stats.columns = info.columnsInfo.length; return info; } diff --git a/test/fixtures/pk-complex-nn2.txt b/test/fixtures/pk-complex-nn2.txt index 777fd79..ee18e4f 100644 --- a/test/fixtures/pk-complex-nn2.txt +++ b/test/fixtures/pk-complex-nn2.txt @@ -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 - diff --git a/test/fixtures/pk-custom.result.yaml b/test/fixtures/pk-custom.result.yaml index 5333972..58acaa2 100644 --- a/test/fixtures/pk-custom.result.yaml +++ b/test/fixtures/pk-custom.result.yaml @@ -28,3 +28,8 @@ opts: maxScale: null hasNullValues: false hasCientificNotation: null +stats: + rows: 3 + columns: 4 + #numericColumns: 0 + #nullColumns: 0 \ No newline at end of file diff --git a/test/test.js b/test/test.js index db52ddd..26fc9dc 100644 --- a/test/test.js +++ b/test/test.js @@ -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); }); } diff --git a/web/txt-to-sql.js b/web/txt-to-sql.js index 9e9c47f..e75a0a0 100644 --- a/web/txt-to-sql.js +++ b/web/txt-to-sql.js @@ -663,6 +663,8 @@ function initializeStats(info) { } function finalizeStats(info) { + info.stats.rows = info.rows.length; + info.stats.columns = info.columnsInfo.length; return info; }