@@ -421,7 +421,40 @@ function runTests (solc, versionText) {
421
421
st . end ( ) ;
422
422
} ) ;
423
423
424
- t . test ( 'compiling standard JSON' , function ( st ) {
424
+ t . test ( 'compiling standard JSON (single file)' , function ( st ) {
425
+ var input = {
426
+ 'language' : 'Solidity' ,
427
+ 'settings' : {
428
+ 'outputSelection' : {
429
+ '*' : {
430
+ '*' : [ 'evm.bytecode' , 'evm.gasEstimates' ]
431
+ }
432
+ }
433
+ } ,
434
+ 'sources' : {
435
+ 'c.sol' : {
436
+ 'content' : 'contract C { function g() public { } function h() internal {} }'
437
+ }
438
+ }
439
+ } ;
440
+
441
+ var output = JSON . parse ( solc . compile ( JSON . stringify ( input ) ) ) ;
442
+ st . ok ( expectNoError ( output ) ) ;
443
+ var C = getBytecodeStandard ( output , 'c.sol' , 'C' ) ;
444
+ st . ok ( typeof C === 'string' ) ;
445
+ st . ok ( C . length > 0 ) ;
446
+ var CGas = getGasEstimate ( output , 'c.sol' , 'C' ) ;
447
+ st . ok ( typeof CGas === 'object' ) ;
448
+ st . ok ( typeof CGas [ 'creation' ] === 'object' ) ;
449
+ st . ok ( typeof CGas [ 'creation' ] [ 'codeDepositCost' ] === 'string' ) ;
450
+ st . ok ( typeof CGas [ 'external' ] === 'object' ) ;
451
+ st . ok ( typeof CGas [ 'external' ] [ 'g()' ] === 'string' ) ;
452
+ st . ok ( typeof CGas [ 'internal' ] === 'object' ) ;
453
+ st . ok ( typeof CGas [ 'internal' ] [ 'h()' ] === 'string' ) ;
454
+ st . end ( ) ;
455
+ } ) ;
456
+
457
+ t . test ( 'compiling standard JSON (multiple files)' , function ( st ) {
425
458
// <0.1.6 doesn't have this
426
459
if ( ! solc . features . multipleInputs ) {
427
460
st . skip ( 'Not supported by solc' ) ;
0 commit comments