diff options
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.74.0/emscripten/test/test_run.js')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.74.0/emscripten/test/test_run.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/emscripten/test/test_run.js b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/emscripten/test/test_run.js new file mode 100644 index 00000000..27627094 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/emscripten/test/test_run.js @@ -0,0 +1,18 @@ +exports.test = function(libUncrustify, assert){ + var uncrustify = libUncrustify(); + + var input = ' string a = "aaaa";'; + var expectedOutput = 'string a = "aaaa";'; + var generatedOutput = uncrustify.uncrustify( input, uncrustify.Language.CPP ); + + assert.deepEqual(expectedOutput, generatedOutput, "comparing expectedOutput and generatedOutput"); + + uncrustify.destruct(); +}; + +if (module == require.main) { + if(process.argv.length < 3) {throw "libUncrustify.js path missing";} + var uncrustify = require(process.argv[2]); + var assert = require("assert"); + exports.test(uncrustify, assert); +} |