File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -676,6 +676,35 @@ function runTests (solc, versionText) {
676
676
st . end ( ) ;
677
677
} ) ;
678
678
679
+ t . test ( 'compiling standard JSON (with warning >=0.4.0)' , function ( st ) {
680
+ // In 0.4.0 "pragma solidity" was added. Not including it is a warning.
681
+ if ( semver . lt ( solc . semver ( ) , '0.4.0' ) ) {
682
+ st . skip ( 'Not supported by solc' ) ;
683
+ st . end ( ) ;
684
+ return ;
685
+ }
686
+
687
+ var input = {
688
+ 'language' : 'Solidity' ,
689
+ 'settings' : {
690
+ 'outputSelection' : {
691
+ '*' : {
692
+ '*' : [ 'evm.bytecode' ]
693
+ }
694
+ }
695
+ } ,
696
+ 'sources' : {
697
+ 'cont.sol' : {
698
+ 'content' : 'contract C { function f() public { } }'
699
+ }
700
+ }
701
+ } ;
702
+
703
+ var output = JSON . parse ( solc . compile ( JSON . stringify ( input ) ) ) ;
704
+ st . ok ( expectError ( output , 'Warning' , 'Source file does not specify required compiler version!' ) ) ;
705
+ st . end ( ) ;
706
+ } ) ;
707
+
679
708
t . test ( 'compiling standard JSON (using libraries) (using lowlevel API)' , function ( st ) {
680
709
// 0.4.0 has a bug with libraries
681
710
if ( semver . eq ( solc . semver ( ) , '0.4.0' ) ) {
You can’t perform that action at this time.
0 commit comments