Skip to content

Instantly share code, notes, and snippets.

@simontraill
Created October 12, 2017 14:40
Show Gist options
  • Save simontraill/590693448e90022e10186b8981a20759 to your computer and use it in GitHub Desktop.
Save simontraill/590693448e90022e10186b8981a20759 to your computer and use it in GitHub Desktop.
var execSync = require('child_process').execSync;
var assert = require('assert');
var result = 'GOOD';
var results = {
'input1.dat': '[450,460,470,480,490,500,510,520,530,540,6225]',
'input2.dat': '[910,839,1120,1014,1126,900,974,866,1698,1384,10944]',
'input3.dat': '[0,108,0,0,0,0,0,0,0,0,0]'
};
try {
for (var input of Object.keys(results)) {
assert.equal(results[input],execSync("node buckets.js < " + input).toString().trim());
}
} catch (e) {
result = 'BAD';
}
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment