Michelson: add regression test for hash consistency
This commit is contained in:
parent
6eec862617
commit
2e859f14a3
4
test/contracts/hash_consistency_checker.tz
Normal file
4
test/contracts/hash_consistency_checker.tz
Normal file
@ -0,0 +1,4 @@
|
||||
parameter (pair tez (pair timestamp int)) ;
|
||||
return string ;
|
||||
storage unit ;
|
||||
code { CAR ; H ; UNIT ; SWAP ; PAIR }
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user