mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-09-23 03:48:46 +03:00
Test case for issue 861
This commit is contained in:
parent
cfc0f7c6df
commit
06aca879f0
6
tests/issues/issue861.cry
Normal file
6
tests/issues/issue861.cry
Normal file
@ -0,0 +1,6 @@
|
||||
atXis0:
|
||||
{n, a, w}
|
||||
(fin n, Eq a, Zero a, Cmp w, Integral w, Literal n w) =>
|
||||
[n]a -> w -> Bit
|
||||
property atXis0 seq i =
|
||||
zero == seq ==> i < `n ==> seq @ i == zero
|
31
tests/issues/issue861.icry
Normal file
31
tests/issues/issue861.icry
Normal file
@ -0,0 +1,31 @@
|
||||
:l issue861.cry
|
||||
|
||||
:set tests=1000
|
||||
|
||||
:check atXis0`{4, Char, Integer}
|
||||
|
||||
let xs = [0,1,2] : [3]Integer
|
||||
|
||||
xs@0
|
||||
xs@1
|
||||
xs@2
|
||||
xs@3
|
||||
xs@(-1)
|
||||
|
||||
xs!0
|
||||
xs!1
|
||||
xs!2
|
||||
xs!3
|
||||
xs!(-1)
|
||||
|
||||
update xs 0 5
|
||||
update xs 1 5
|
||||
update xs 2 5
|
||||
update xs 3 5
|
||||
update xs (-1) 5
|
||||
|
||||
updateEnd xs 0 5
|
||||
updateEnd xs 1 5
|
||||
updateEnd xs 2 5
|
||||
updateEnd xs 3 5
|
||||
updateEnd xs (-1) 5
|
33
tests/issues/issue861.icry.stdout
Normal file
33
tests/issues/issue861.icry.stdout
Normal file
@ -0,0 +1,33 @@
|
||||
Loading module Cryptol
|
||||
Loading module Cryptol
|
||||
Loading module Main
|
||||
Using random testing.
|
||||
Testing... Passed 1000 tests.
|
||||
0
|
||||
1
|
||||
2
|
||||
|
||||
invalid sequence index: 3
|
||||
|
||||
invalid sequence index: -1
|
||||
2
|
||||
1
|
||||
0
|
||||
|
||||
invalid sequence index: 3
|
||||
|
||||
invalid sequence index: -1
|
||||
[5, 1, 2]
|
||||
[0, 5, 2]
|
||||
[0, 1, 5]
|
||||
|
||||
invalid sequence index: 3
|
||||
|
||||
invalid sequence index: -1
|
||||
[0, 1, 5]
|
||||
[0, 5, 2]
|
||||
[5, 1, 2]
|
||||
|
||||
invalid sequence index: 3
|
||||
|
||||
invalid sequence index: -1
|
Loading…
Reference in New Issue
Block a user