Skip to content

Commit 82941f6

Browse files
committed
Add more assertions to tests
1 parent cfcd9c5 commit 82941f6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/package.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ tape('Linking', function (t) {
293293
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
294294
};
295295
var output = solc.compile({sources: input});
296+
st.ok('contracts' in output);
297+
st.ok('cont.sol:x' in output.contracts);
298+
st.ok('bytecode' in output.contracts['cont.sol:x']);
296299
var bytecode = solc.linkBytecode(output.contracts['cont.sol:x'].bytecode, { 'lib.sol:L': '0x123456' });
297300
st.ok(bytecode.indexOf('_') < 0);
298301
st.end();
@@ -304,6 +307,9 @@ tape('Linking', function (t) {
304307
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
305308
};
306309
var output = solc.compile({sources: input});
310+
st.ok('contracts' in output);
311+
st.ok('cont.sol:x' in output.contracts);
312+
st.ok('bytecode' in output.contracts['cont.sol:x']);
307313
var bytecode = solc.linkBytecode(output.contracts['cont.sol:x'].bytecode, { });
308314
st.ok(bytecode.indexOf('_') >= 0);
309315
st.end();
@@ -315,6 +321,9 @@ tape('Linking', function (t) {
315321
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
316322
};
317323
var output = solc.compile({sources: input});
324+
st.ok('contracts' in output);
325+
st.ok('cont.sol:x' in output.contracts);
326+
st.ok('bytecode' in output.contracts['cont.sol:x']);
318327
st.throws(function () {
319328
solc.linkBytecode(output.contracts['cont.sol:x'].bytecode, { 'lib.sol:L': '' });
320329
});
@@ -327,6 +336,9 @@ tape('Linking', function (t) {
327336
'cont.sol': 'import "lib.sol"; contract x { function g() { L1234567890123456789012345678901234567890.f(); } }'
328337
};
329338
var output = solc.compile({sources: input});
339+
st.ok('contracts' in output);
340+
st.ok('cont.sol:x' in output.contracts);
341+
st.ok('bytecode' in output.contracts['cont.sol:x']);
330342
var bytecode = solc.linkBytecode(output.contracts['cont.sol:x'].bytecode, { 'lib.sol:L1234567890123456789012345678901234567890': '0x123456' });
331343
st.ok(bytecode.indexOf('_') < 0);
332344
st.end();

0 commit comments

Comments
 (0)