Skip to content

Commit 83563ff

Browse files
committed
Add tests for abstract contracts
Which results in no gas estimation.
1 parent df26987 commit 83563ff

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/compiler.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,40 @@ function runTests (solc, versionText) {
468468
st.end();
469469
});
470470

471+
t.test('compiling standard JSON (abstract contract)', function (st) {
472+
// <0.1.6 doesn't have this
473+
if (!solc.features.multipleInputs) {
474+
st.skip('Not supported by solc');
475+
st.end();
476+
return;
477+
}
478+
479+
var isVersion6 = semver.gt(solc.semver(), '0.5.99');
480+
481+
var input = {
482+
'language': 'Solidity',
483+
'settings': {
484+
'outputSelection': {
485+
'*': {
486+
'*': [ 'evm.bytecode', 'evm.gasEstimates' ]
487+
}
488+
}
489+
},
490+
'sources': {
491+
'c.sol': {
492+
'content': (isVersion6 ? 'abstract ' : '') + 'contract C { function f() public; }'
493+
}
494+
}
495+
};
496+
497+
var output = JSON.parse(solc.compile(JSON.stringify(input)));
498+
st.ok(expectNoError(output));
499+
var C = getBytecodeStandard(output, 'c.sol', 'C');
500+
st.ok(typeof C === 'string');
501+
st.ok(C.length === 0);
502+
st.end();
503+
});
504+
471505
t.test('compiling standard JSON (with imports)', function (st) {
472506
// <0.2.1 doesn't have this
473507
if (!solc.features.importCallback) {

0 commit comments

Comments
 (0)