Commit b9697822 b96978220c79ca0538cf6686dd56ca5de04c335d by Vincent Peybernes

#8 Improve result test of election - add display matrix job

1 parent 6594f290
Pipeline #18 for b9697822 failed in 26 seconds
...@@ -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[][]}
......