Add test for multi-contract files with inheritance (#836)

pull/838/head
cgewecke 10 months ago committed by GitHub
parent ecd808cdd7
commit 16c2a04e46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 35
      test/sources/solidity/contracts/statements/multi-contract-diamond.sol
  2. 5
      test/units/statements.js

@ -0,0 +1,35 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
contract A {
uint valA;
function setA() public {
valA = 1;
}
}
contract B is A {
uint valB;
function setB() public {
valB = 1;
}
}
contract C is A {
uint valC;
function setC() public {
valC = 1;
}
}
contract D is B, C {
uint valD;
function setD() public {
valD = 1;
}
}

@ -66,6 +66,11 @@ describe('generic statements', () => {
util.report(info.solcOutput.errors);
})
it('should instrument a multi-contract file with diamond inheritance (#769)', () => {
const info = util.instrumentAndCompile('statements/multi-contract-diamond');
util.report(info.solcOutput.errors);
});
it('should NOT pass tests if the contract has a compilation error', () => {
const info = util.instrumentAndCompile('app/SimpleError');
try {

Loading…
Cancel
Save