simple bugfixes

pull/3/head
JP Smith 7 years ago
parent 43690ef302
commit 917ae45429
  1. 2
      examples/simple/Simple.hs
  2. 2
      examples/state-machine/StateMachine.hs
  3. 3
      lib/Echidna/Exec.hs
  4. 12
      solidity/cli.sol

@ -1,4 +1,4 @@
module Simple where
module Main where
import Control.Lens

@ -1,6 +1,6 @@
{-# LANGUAGE FlexibleContexts, KindSignatures #-}
module StateMachine where
module Main where
import Control.Monad.IO.Class

@ -85,7 +85,8 @@ ePropertySeq :: VM -- Initial state
-> Property
ePropertySeq v ts p n = property $ executeSequential (VMState v) =<<
forAllWith printCallSeq (sequential (linear 1 n) (VMState v) [eCommand ts p]) where
printCallSeq = ("Call sequence: " ++) . intercalate "\n " . map showCall . sequentialActions
printCallSeq = ("Call sequence: " ++) . intercalate "\n " .
map showCall . reverse . sequentialActions
showCall (Action i _ _ _ _ _) = show i ++ ";"
-- Should work, but missing instance MonadBaseControl b m => MonadBaseControl b (PropertyT m)

@ -1,15 +1,19 @@
pragma solidity ^0.4.16;
contract Test {
bool private flag=true;
bool private flag0=true;
bool private flag1=true;
function set(int val) returns (bool){
if (val % 100 == 0) {flag = false;}
function set0(int val) returns (bool){
if (val % 10 == 0) {flag0 = false;}
}
function set1(int val) returns (bool){
if (val % 10 == 0 && flag0) {flag1 = false;}
}
function echidna_alwaystrue() returns (bool){
return(true);
}
function echidna_sometimesfalse() returns (bool){
return(flag);
return(flag0 || flag1);
}
}

Loading…
Cancel
Save