git ssb

0+

wanderer🌟 / js-primea-objects



Commit 84ba3e8e963a6d6e795d80f49375060aef82805b

fix tests

Norton Wang committed on 4/27/2018, 5:06:53 PM
Parent: a3edc2a316c77976c2fdd490b0c132e831262e48

Files changed

tests/index.jschanged
tests/index.jsView
@@ -77,14 +77,14 @@
7777 gas: 100
7878 }),
7979 Buffer.from([1, 2, 3, 4])
8080 ]
81- const json = utils.toJSON(obj)
81 + const jsonFull = utils.toJSON(obj)
82 + t.deepEquals(JSON.stringify(jsonFull), '[{"@ModuleRef":{"id":"0x01","exports":{"name":["i32"]}}},{"@FunctionRef":{"actorID":"0x01","private":false,"name":"main","gas":100,"params":["i32"]}},"0x01020304"]')
83 +
84 + const json = utils.toJSON(obj, false)
8285 t.deepEquals(JSON.stringify(json), '[{"@ModuleRef":{"id":"0x01"}},{"@FunctionRef":{"actorID":"0x01","private":false,"name":"main","gas":100}},"0x01020304"]')
8386
84- const jsonFull = utils.toJSON(obj, true)
85- t.deepEquals(JSON.stringify(jsonFull), '[{"@ModuleRef":{"id":"0x01","exports":{"name":["i32"]}}},{"@FunctionRef":{"actorID":"0x01","private":false,"name":"main","gas":100,"params":["i32"]}},"0x01020304"]')
86-
8787 const newObj = [
8888 new objects.ModuleRef(undefined, id),
8989 new objects.FunctionRef({
9090 identifier: [false, 'main'],

Built with git-ssb-web