Add multi else-if instrumentation test

pull/335/head
cgewecke 5 years ago
parent 8ccdd6428f
commit 2f6a73d880
  1. 1
      test/assembly.js
  2. 8
      test/if.js

@ -17,7 +17,6 @@ describe('generic expressions', () => {
const contract = util.getCode('assembly/spaces-in-function.sol');
const info = getInstrumentedVersion(contract, filePath);
const output = JSON.parse(solc.compile(util.codeToCompilerInput(info.contract)));
console.log(info)
util.report(output.errors);
});

@ -1,5 +1,6 @@
/* eslint-env node, mocha */
const solc = require('solc');
const path = require('path');
const getInstrumentedVersion = require('./../lib/instrumentSolidity.js');
const util = require('./util/util.js');
@ -11,6 +12,13 @@ describe('if, else, and else if statements', () => {
const filePath = path.resolve('./test.sol');
const pathPrefix = './';
it('should compile after instrumenting multiple if-elses', () => {
const contract = util.getCode('if/else-if-unbracketed-multi.sol');
const info = getInstrumentedVersion(contract, filePath);
const output = JSON.parse(solc.compile(util.codeToCompilerInput(info.contract)));
util.report(output.errors);
});
it('should cover an if statement with a bracketed consequent', done => {
const contract = util.getCode('if/if-with-brackets.sol');
const info = getInstrumentedVersion(contract, filePath);

Loading…
Cancel
Save