diff options
Diffstat (limited to 'GeneralStateTests/schema/validate.js')
-rwxr-xr-x | GeneralStateTests/schema/validate.js | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/GeneralStateTests/schema/validate.js b/GeneralStateTests/schema/validate.js index 6f2feef9b..af3e3b495 100755 --- a/GeneralStateTests/schema/validate.js +++ b/GeneralStateTests/schema/validate.js @@ -15,15 +15,13 @@ var rl = readline.createInterface({ }); rl.on('line', function(line){ - fs.readFile('simple-schema.json', function(err, data) { + fs.readFile('schema.json', function(err, data) { if (err) { throw err; } - schema = JSON.parse(data); - fs.readFile(line, function(err, data) { if (err) { throw err; @@ -32,35 +30,19 @@ rl.on('line', function(line){ try { testCode = JSON.parse(data); } catch(e) { - debugger; + console.log(e); } try { var x = validate(testCode, schema); + + if (x.errors.length > 0) { + console.log(line+':\n'); + console.log(x.errors+'\n') + } } catch(e) { - console.log(line); + console.log(e); } - }); }); }); - -/* -fs.readFile('simple-schema.json', function(err, data) { - if (err) { - throw err; - } - - schema = JSON.parse(data); - fs.readFile('example.json', function(err, data) { - if (err) { - throw err; - } - - testCode = JSON.parse(data); - var x = validate(testCode, schema); - console.log(x); - debugger; - }); -}); -*/ |