Code coverage for Solidity smart-contracts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
solidity-coverage/test/sources/solidity/contracts/statements/library.sol

24 lines
521 B

pragma solidity ^0.7.0;
/*
Library and Using statements: invoking 'Test.not' should generate line and statement
coverage for L 9, 10, and 19, plus function coverage for 'flip' and 'not'.
*/
library Boolean {
struct Value { bool val; }
function flip(Value storage self) internal returns (bool) {
self.val = !self.val;
return self.val;
}
}
contract Test {
using Boolean for Boolean.Value;
Boolean.Value b;
function not() public returns (bool) {
return b.flip();
}
}