#8 Improve result test of election - add display matrix job
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -4,6 +4,7 @@ | ... | @@ -4,6 +4,7 @@ |
4 | var RelativePlacement = require('../../lib/relative-placement'); | 4 | var RelativePlacement = require('../../lib/relative-placement'); |
5 | var data = require('./results_data.json'); | 5 | var data = require('./results_data.json'); |
6 | var util = require('util'); | 6 | var util = require('util'); |
7 | var exitCode = 0; | ||
7 | 8 | ||
8 | console.log('############################'); | 9 | console.log('############################'); |
9 | console.log('# Details of result matrix #'); | 10 | console.log('# Details of result matrix #'); |
... | @@ -37,6 +38,7 @@ data.forEach((testCase, num) => { | ... | @@ -37,6 +38,7 @@ data.forEach((testCase, num) => { |
37 | 38 | ||
38 | log.push(expected[place]); | 39 | log.push(expected[place]); |
39 | log.push('\t|\t'); | 40 | log.push('\t|\t'); |
41 | if(candidateName != expected[place]) exitCode = 1; | ||
40 | (candidateName != expected[place]) ? log.push('*') : log.push(' '); | 42 | (candidateName != expected[place]) ? log.push('*') : log.push(' '); |
41 | log.push(candidateName); | 43 | log.push(candidateName); |
42 | log.push('\t'); | 44 | log.push('\t'); |
... | @@ -59,6 +61,8 @@ data.forEach((testCase, num) => { | ... | @@ -59,6 +61,8 @@ data.forEach((testCase, num) => { |
59 | console.log(''); | 61 | console.log(''); |
60 | }); | 62 | }); |
61 | 63 | ||
64 | process.exit(exitCode); | ||
65 | |||
62 | /** | 66 | /** |
63 | * @param {TestData} testData | 67 | * @param {TestData} testData |
64 | * @return {String[][]} | 68 | * @return {String[][]} | ... | ... |
-
Please register or sign in to post a comment