Skip to content

Commit a9f1a58

Browse files
authored
Merge pull request #626 from ethereum/fix-version-test-dont-compare-with-package-json
Fix CLI `--version` test to use version from the binary not `package.json`
2 parents b3d83d9 + 9a16f3d commit a9f1a58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/cli.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import tape from 'tape';
22
import spawn from 'tape-spawn';
33
import * as path from 'path';
4-
const pkg = require('../package.json');
4+
import solc from '../';
55

66
tape('CLI', function (t) {
77
t.test('--version', function (st) {
88
const spt = spawn(st, './solc.js --version');
9-
spt.stdout.match(RegExp(pkg.version + '(-[^a-zA-A0-9.+]+)?(\\+[^a-zA-Z0-9.-]+)?'));
9+
spt.stdout.match(solc.version() + '\n');
10+
spt.stdout.match(/^\s*[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?\+commit\.[0-9a-f]+([a-zA-Z0-9.-]+)?\s*$/);
1011
spt.stderr.empty();
1112
spt.end();
1213
});

0 commit comments

Comments
 (0)