Skip to content

Commit ab2f003

Browse files
authored
Merge pull request #291 from ethereum/standard-json-tests
Reorder standard JSON tests to prefer the 'wrapper' as the non-lowlevel API)
2 parents 3a1f77d + 8c57fbe commit ab2f003

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/package.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ tape('Compilation', function (t) {
329329
st.end();
330330
});
331331

332-
t.test('compiling standard JSON', function (st) {
333-
if (!solc.supportsStandard) {
334-
st.skip('Not supported by solc');
332+
t.test('compiling standard JSON (using lowlevel API)', function (st) {
333+
if (typeof solc.lowlevel.compileStandard !== 'function') {
334+
st.skip('Low-level compileStandard interface not implemented by this compiler version.');
335335
st.end();
336336
return;
337337
}
@@ -363,15 +363,15 @@ tape('Compilation', function (t) {
363363
}
364364
}
365365

366-
var output = JSON.parse(solc.compileStandard(JSON.stringify(input)));
366+
var output = JSON.parse(solc.lowlevel.compileStandard(JSON.stringify(input)));
367367
st.ok(bytecodeExists(output, 'cont.sol', 'x'));
368368
st.ok(bytecodeExists(output, 'lib.sol', 'L'));
369369
st.end();
370370
});
371371

372-
t.test('invalid source code fails properly with standard JSON', function (st) {
373-
if (!solc.supportsStandard) {
374-
st.skip('Not supported by solc');
372+
t.test('invalid source code fails properly with standard JSON (using lowlevel API)', function (st) {
373+
if (typeof solc.lowlevel.compileStandard !== 'function') {
374+
st.skip('Low-level compileStandard interface not implemented by this compiler version.');
375375
st.end();
376376
return;
377377
}
@@ -391,7 +391,7 @@ tape('Compilation', function (t) {
391391
}
392392
}
393393
};
394-
var output = JSON.parse(solc.compileStandard(JSON.stringify(input)));
394+
var output = JSON.parse(solc.lowlevel.compileStandard(JSON.stringify(input)));
395395
st.plan(3);
396396
st.ok('errors' in output);
397397
st.ok(output.errors.length >= 1);
@@ -404,9 +404,9 @@ tape('Compilation', function (t) {
404404
st.end();
405405
});
406406

407-
t.test('compiling standard JSON (with callback)', function (st) {
408-
if (!solc.supportsStandard) {
409-
st.skip('Not supported by solc');
407+
t.test('compiling standard JSON (with callback) (using lowlevel API)', function (st) {
408+
if (typeof solc.lowlevel.compileStandard !== 'function') {
409+
st.skip('Low-level compileStandard interface not implemented by this compiler version.');
410410
st.end();
411411
return;
412412
}
@@ -443,13 +443,13 @@ tape('Compilation', function (t) {
443443
}
444444
}
445445

446-
var output = JSON.parse(solc.compileStandard(JSON.stringify(input), findImports));
446+
var output = JSON.parse(solc.lowlevel.compileStandard(JSON.stringify(input), findImports));
447447
st.ok(bytecodeExists(output, 'cont.sol', 'x'));
448448
st.ok(bytecodeExists(output, 'lib.sol', 'L'));
449449
st.end();
450450
});
451451

452-
t.test('compiling standard JSON (using wrapper)', function (st) {
452+
t.test('compiling standard JSON', function (st) {
453453
// Example needs support for compileJSONMulti
454454
// FIXME: add test for wrapper without multiple files
455455
if (semver.lt(solc.semver(), '0.1.6')) {
@@ -487,7 +487,7 @@ tape('Compilation', function (t) {
487487
st.end();
488488
});
489489

490-
t.test('compiling standard JSON (using wrapper and libraries)', function (st) {
490+
t.test('compiling standard JSON (using libraries)', function (st) {
491491
// Example needs support for compileJSONMulti
492492
// FIXME: add test for wrapper without multiple files
493493
if (semver.lt(solc.semver(), '0.1.6')) {
@@ -531,7 +531,7 @@ tape('Compilation', function (t) {
531531
st.end();
532532
});
533533

534-
t.test('compiling standard JSON (using lowlevel API)', function (st) {
534+
t.test('compiling standard JSON (using libraries) (using lowlevel API)', function (st) {
535535
if (typeof solc.lowlevel.compileStandard !== 'function') {
536536
st.skip('Low-level compileStandard interface not implemented by this compiler version.');
537537
st.end();

0 commit comments

Comments
 (0)