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

23 lines
529 B

pragma solidity >=0.8.0 <0.9.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();
}
}