1
1
const tape = require ( 'tape' ) ;
2
+ const semver = require ( 'semver' ) ;
2
3
const solc = require ( '../index.js' ) ;
3
4
4
5
tape ( 'Version and license' , function ( t ) {
@@ -40,6 +41,12 @@ tape('Compilation', function (t) {
40
41
} ) ;
41
42
42
43
t . test ( 'multiple files can be compiled' , function ( st ) {
44
+ if ( semver . lt ( solc . semver ( ) , '0.1.6' ) ) {
45
+ st . skip ( 'Not supported by solc <0.1.6' ) ;
46
+ st . end ( ) ;
47
+ return ;
48
+ }
49
+
43
50
var input = {
44
51
'lib.sol' : 'library L { function f() returns (uint) { return 7; } }' ,
45
52
'cont.sol' : 'import "lib.sol"; contract x { function g() { L.f(); } }'
@@ -56,6 +63,12 @@ tape('Compilation', function (t) {
56
63
} ) ;
57
64
58
65
t . test ( 'lazy-loading callback works' , function ( st ) {
66
+ if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
67
+ st . skip ( 'Not supported by solc <0.2.1' ) ;
68
+ st . end ( ) ;
69
+ return ;
70
+ }
71
+
59
72
var input = {
60
73
'cont.sol' : 'import "lib.sol"; contract x { function g() { L.f(); } }'
61
74
} ;
@@ -78,6 +91,12 @@ tape('Compilation', function (t) {
78
91
} ) ;
79
92
80
93
t . test ( 'lazy-loading callback works (with file not found)' , function ( st ) {
94
+ if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
95
+ st . skip ( 'Not supported by solc <0.2.1' ) ;
96
+ st . end ( ) ;
97
+ return ;
98
+ }
99
+
81
100
var input = {
82
101
'cont.sol' : 'import "lib.sol"; contract x { function g() { L.f(); } }'
83
102
} ;
@@ -100,6 +119,12 @@ tape('Compilation', function (t) {
100
119
} ) ;
101
120
102
121
t . test ( 'lazy-loading callback works (with exception)' , function ( st ) {
122
+ if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
123
+ st . skip ( 'Not supported by solc <0.2.1' ) ;
124
+ st . end ( ) ;
125
+ return ;
126
+ }
127
+
103
128
var input = {
104
129
'cont.sol' : 'import "lib.sol"; contract x { function g() { L.f(); } }'
105
130
} ;
@@ -113,6 +138,12 @@ tape('Compilation', function (t) {
113
138
} ) ;
114
139
115
140
t . test ( 'file import without lazy-loading callback fails properly' , function ( st ) {
141
+ if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
142
+ st . skip ( 'Not supported by solc <0.2.1' ) ;
143
+ st . end ( ) ;
144
+ return ;
145
+ }
146
+
116
147
var input = {
117
148
'cont.sol' : 'import "lib.sol"; contract x { function g() { L.f(); } }'
118
149
} ;
0 commit comments