Skip to content

Commit 96ad683

Browse files
committed
Do not run tests on old compilers for non-existent features
1 parent f9e0953 commit 96ad683

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/package.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const tape = require('tape');
2+
const semver = require('semver');
23
const solc = require('../index.js');
34

45
tape('Version and license', function (t) {
@@ -40,6 +41,12 @@ tape('Compilation', function (t) {
4041
});
4142

4243
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+
4350
var input = {
4451
'lib.sol': 'library L { function f() returns (uint) { return 7; } }',
4552
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
@@ -56,6 +63,12 @@ tape('Compilation', function (t) {
5663
});
5764

5865
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+
5972
var input = {
6073
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
6174
};
@@ -78,6 +91,12 @@ tape('Compilation', function (t) {
7891
});
7992

8093
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+
81100
var input = {
82101
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
83102
};
@@ -100,6 +119,12 @@ tape('Compilation', function (t) {
100119
});
101120

102121
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+
103128
var input = {
104129
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
105130
};
@@ -113,6 +138,12 @@ tape('Compilation', function (t) {
113138
});
114139

115140
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+
116147
var input = {
117148
'cont.sol': 'import "lib.sol"; contract x { function g() { L.f(); } }'
118149
};

0 commit comments

Comments
 (0)