Skip to content

Commit

Permalink
Merge pull request #626 from ethereum/fix-version-test-dont-compare-w…
Browse files Browse the repository at this point in the history
…ith-package-json

Fix CLI `--version` test to use version from the binary not `package.json`
  • Loading branch information
cameel authored Jun 10, 2022
2 parents b3d83d9 + 9a16f3d commit a9f1a58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/cli.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import tape from 'tape';
import spawn from 'tape-spawn';
import * as path from 'path';
const pkg = require('../package.json');
import solc from '../';

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

0 comments on commit a9f1a58

Please sign in to comment.