From d904e4424c3ec2517fb5c87a459dbdc7d89aadd9 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Wed, 4 Mar 2015 21:25:00 +1100 Subject: [PATCH] tests: add failing scripts by cross-verifying ASM/Hex --- test/script.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/script.js b/test/script.js index 1af2c1c..a202206 100644 --- a/test/script.js +++ b/test/script.js @@ -28,8 +28,13 @@ describe('Script', function () { describe('fromASM/toASM', function () { fixtures.valid.forEach(function (f) { + if (!f.asm) return + it('decodes/encodes ' + f.description, function () { - assert.equal(Script.fromASM(f.asm).toASM(), f.asm) + var script = Script.fromASM(f.asm) + + assert.equal(script.toASM(), f.asm) + assert.equal(script.toHex(), f.hex) }) }) }) @@ -37,7 +42,10 @@ describe('Script', function () { describe('fromHex/toHex', function () { fixtures.valid.forEach(function (f) { it('decodes/encodes ' + f.description, function () { - assert.equal(Script.fromHex(f.hex).toHex(), f.hex) + var script = Script.fromHex(f.hex) + + assert.equal(script.toASM(), f.asm) + assert.equal(script.toHex(), f.hex) }) }) })