@@ -56,13 +56,25 @@ tape('Compilation', function (t) {
56
56
} ) ;
57
57
t . test ( 'invalid source code fails properly' , function ( st ) {
58
58
var output = solc . compile ( 'contract x { this is an invalid contract }' ) ;
59
+ if ( semver . lt ( solc . semver ( ) , '0.1.4' ) ) {
60
+ st . ok ( output . error . indexOf ( 'Parser error: Expected identifier' ) !== - 1 ) ;
61
+ st . end ( ) ;
62
+ return ;
63
+ }
59
64
st . plan ( 3 ) ;
60
65
st . ok ( 'errors' in output ) ;
61
66
// Check if the ParserError exists, but allow others too
62
67
st . ok ( output . errors . length >= 1 ) ;
63
68
for ( var error in output . errors ) {
64
- // In early versions it was only displaying "Error: Expected identifier" as opposed to "ParserError"
65
- if ( output . errors [ error ] . indexOf ( 'ParserError' ) !== - 1 || output . errors [ error ] . indexOf ( 'Error: Expected identifier' ) !== - 1 ) {
69
+ // Error should be something like:
70
+ // ParserError
71
+ // Error: Expected identifier
72
+ // Parser error: Expected identifier
73
+ if (
74
+ output . errors [ error ] . indexOf ( 'ParserError' ) !== - 1 ||
75
+ output . errors [ error ] . indexOf ( 'Error: Expected identifier' ) !== - 1 ||
76
+ output . errors [ error ] . indexOf ( 'Parser error: Expected identifier' ) !== - 1
77
+ ) {
66
78
st . ok ( true ) ;
67
79
}
68
80
}
@@ -309,6 +321,14 @@ tape('Compilation', function (t) {
309
321
st . end ( ) ;
310
322
} ) ;
311
323
t . test ( 'compiling standard JSON (using wrapper)' , function ( st ) {
324
+ // Example needs support for compileJSONMulti
325
+ // FIXME: add test for wrapper without multiple files
326
+ if ( semver . lt ( solc . semver ( ) , '0.1.6' ) ) {
327
+ st . skip ( 'Not supported by solc <0.1.6' ) ;
328
+ st . end ( ) ;
329
+ return ;
330
+ }
331
+
312
332
var input = {
313
333
'language' : 'Solidity' ,
314
334
'settings' : {
@@ -353,6 +373,14 @@ tape('Loading Legacy Versions', function (t) {
353
373
} ) ;
354
374
355
375
tape ( 'Linking' , function ( t ) {
376
+ // FIXME: all the linking tests require compileJSONMulti support,
377
+ // create test cases which have all files in a single source and could run with 0.1.3
378
+ if ( semver . lt ( solc . semver ( ) , '0.1.6' ) ) {
379
+ t . skip ( 'Not supported by solc <0.1.6' ) ;
380
+ t . end ( ) ;
381
+ return ;
382
+ }
383
+
356
384
t . test ( 'link properly' , function ( st ) {
357
385
var input = {
358
386
'lib.sol' : 'library L { function f() returns (uint) { return 7; } }' ,
0 commit comments