Michelson: add regression test for hash consistency

This commit is contained in:
Benjamin Canou 2017-12-16 01:30:07 +01:00
parent 6eec862617
commit 2e859f14a3
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,4 @@
parameter (pair tez (pair timestamp int)) ;
return string ;
storage unit ;
code { CAR ; H ; UNIT ; SWAP ; PAIR }

View File

@ -410,6 +410,15 @@ assert_fails $client typecheck data '(Map (Item 0 1) (Item 10 1) (Item 5 1))' ag
assert_fails $client typecheck data '(Set "A" "C" "B")' against type '(set string)'
assert_fails $client typecheck data '(Set "A" "B" "B")' against type '(set string)'
hash_result=`$client hash data '(Pair "22220.00" (Pair "2017-12-13T04:49:00Z" 034))' \
of type '(pair tez (pair timestamp int))'`
assert_output $CONTRACT_PATH/hash_consistency_checker.tz Unit \
'(Pair "22220.00" (Pair "2017-12-13T04:49:00Z" 034))' "$hash_result"
assert_output $CONTRACT_PATH/hash_consistency_checker.tz Unit \
'(Pair "22,220" (Pair "2017-12-13T04:49:00+00:00" 34))' "$hash_result"
printf "\nEnd of test\n"
show_logs="no"