@@ -53,6 +53,7 @@ tape('Compilation', function (t) {
53
53
st . end ( ) ;
54
54
return ;
55
55
}
56
+
56
57
var output = solc . compile ( 'contract x { function g() public {} }' ) ;
57
58
st . ok ( 'contracts' in output ) ;
58
59
var bytecode = getBytecode ( output , '' , 'x' ) ;
@@ -67,6 +68,7 @@ tape('Compilation', function (t) {
67
68
st . end ( ) ;
68
69
return ;
69
70
}
71
+
70
72
var output = JSON . parse ( solc . lowlevel . compileSingle ( 'contract x { function g() public {} }' ) ) ;
71
73
st . ok ( 'contracts' in output ) ;
72
74
var bytecode = getBytecode ( output , '' , 'x' ) ;
@@ -81,6 +83,7 @@ tape('Compilation', function (t) {
81
83
st . end ( ) ;
82
84
return ;
83
85
}
86
+
84
87
var output = solc . compile ( 'contract x { this is an invalid contract }' ) ;
85
88
if ( semver . lt ( solc . semver ( ) , '0.1.4' ) ) {
86
89
st . ok ( output . error . indexOf ( 'Parser error: Expected identifier' ) !== - 1 ) ;
@@ -108,12 +111,7 @@ tape('Compilation', function (t) {
108
111
} ) ;
109
112
110
113
t . test ( 'multiple files can be compiled' , function ( st ) {
111
- if ( semver . lt ( solc . semver ( ) , '0.1.6' ) ) {
112
- st . skip ( 'Not supported by solc <0.1.6' ) ;
113
- st . end ( ) ;
114
- return ;
115
- }
116
-
114
+ // <0.1.6 doesn't have this
117
115
if ( ! solc . features . multipleInputs ) {
118
116
st . skip ( 'Not supported by solc' ) ;
119
117
st . end ( ) ;
@@ -156,12 +154,7 @@ tape('Compilation', function (t) {
156
154
} ) ;
157
155
158
156
t . test ( 'lazy-loading callback works' , function ( st ) {
159
- if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
160
- st . skip ( 'Not supported by solc <0.2.1' ) ;
161
- st . end ( ) ;
162
- return ;
163
- }
164
-
157
+ // <0.2.1 doesn't have this
165
158
if ( ! solc . features . importCallback ) {
166
159
st . skip ( 'Not supported by solc' ) ;
167
160
st . end ( ) ;
@@ -216,12 +209,7 @@ tape('Compilation', function (t) {
216
209
} ) ;
217
210
218
211
t . test ( 'lazy-loading callback works (with file not found)' , function ( st ) {
219
- if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
220
- st . skip ( 'Not supported by solc <0.2.1' ) ;
221
- st . end ( ) ;
222
- return ;
223
- }
224
-
212
+ // <0.2.1 doesn't have this
225
213
if ( ! solc . features . importCallback ) {
226
214
st . skip ( 'Not supported by solc' ) ;
227
215
st . end ( ) ;
@@ -251,12 +239,7 @@ tape('Compilation', function (t) {
251
239
} ) ;
252
240
253
241
t . test ( 'lazy-loading callback works (with exception)' , function ( st ) {
254
- if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
255
- st . skip ( 'Not supported by solc <0.2.1' ) ;
256
- st . end ( ) ;
257
- return ;
258
- }
259
-
242
+ // <0.2.1 doesn't have this
260
243
if ( ! solc . features . importCallback ) {
261
244
st . skip ( 'Not supported by solc' ) ;
262
245
st . end ( ) ;
@@ -276,12 +259,7 @@ tape('Compilation', function (t) {
276
259
} ) ;
277
260
278
261
t . test ( 'lazy-loading callback fails properly (with invalid callback)' , function ( st ) {
279
- if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
280
- st . skip ( 'Not supported by solc <0.2.1' ) ;
281
- st . end ( ) ;
282
- return ;
283
- }
284
-
262
+ // <0.2.1 doesn't have this
285
263
if ( ! solc . features . importCallback ) {
286
264
st . skip ( 'Not supported by solc' ) ;
287
265
st . end ( ) ;
@@ -298,12 +276,7 @@ tape('Compilation', function (t) {
298
276
} ) ;
299
277
300
278
t . test ( 'file import without lazy-loading callback fails properly' , function ( st ) {
301
- if ( semver . lt ( solc . semver ( ) , '0.2.1' ) ) {
302
- st . skip ( 'Not supported by solc <0.2.1' ) ;
303
- st . end ( ) ;
304
- return ;
305
- }
306
-
279
+ // <0.2.1 doesn't have this
307
280
if ( ! solc . features . importCallback ) {
308
281
st . skip ( 'Not supported by solc' ) ;
309
282
st . end ( ) ;
@@ -450,10 +423,9 @@ tape('Compilation', function (t) {
450
423
} ) ;
451
424
452
425
t . test ( 'compiling standard JSON' , function ( st ) {
453
- // Example needs support for compileJSONMulti
454
- // FIXME: add test for wrapper without multiple files
455
- if ( semver . lt ( solc . semver ( ) , '0.1.6' ) ) {
456
- st . skip ( 'Not supported by solc <0.1.6' ) ;
426
+ // <0.1.6 doesn't have this
427
+ if ( ! solc . features . multipleInputs ) {
428
+ st . skip ( 'Not supported by solc' ) ;
457
429
st . end ( ) ;
458
430
return ;
459
431
}
@@ -488,10 +460,9 @@ tape('Compilation', function (t) {
488
460
} ) ;
489
461
490
462
t . test ( 'compiling standard JSON (using libraries)' , function ( st ) {
491
- // Example needs support for compileJSONMulti
492
- // FIXME: add test for wrapper without multiple files
493
- if ( semver . lt ( solc . semver ( ) , '0.1.6' ) ) {
494
- st . skip ( 'Not supported by solc <0.1.6' ) ;
463
+ // <0.1.6 doesn't have this
464
+ if ( ! solc . features . multipleInputs ) {
465
+ st . skip ( 'Not supported by solc' ) ;
495
466
st . end ( ) ;
496
467
return ;
497
468
}
0 commit comments