mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-11-24 04:43:25 +03:00
Add coverage006 test
This commit is contained in:
parent
22febdf7ff
commit
fbff80545d
20
tests/idris2/coverage006/Cover.idr
Normal file
20
tests/idris2/coverage006/Cover.idr
Normal file
@ -0,0 +1,20 @@
|
||||
import Data.Fin
|
||||
|
||||
data NNat = NZ | NS NNat
|
||||
|
||||
zsym : (x : NNat) -> x = NZ -> NZ = x
|
||||
zsym NZ Refl = Refl
|
||||
zsym (NS _) Refl impossible
|
||||
|
||||
zsym' : (x : NNat) -> x = NZ -> NZ = x
|
||||
zsym' NZ Refl = Refl
|
||||
|
||||
foo : Nat -> String
|
||||
foo 0 = "zero"
|
||||
foo 1 = "one"
|
||||
foo x = "something else"
|
||||
|
||||
bar : Fin (S (S (S Z))) -> String
|
||||
bar 0 = "a"
|
||||
bar 1 = "b"
|
||||
bar 2 = "c"
|
3
tests/idris2/coverage006/expected
Normal file
3
tests/idris2/coverage006/expected
Normal file
@ -0,0 +1,3 @@
|
||||
1/1: Building foobar (foobar.idr)
|
||||
Main> Main.foo is total
|
||||
Main> Bye for now!
|
7
tests/idris2/coverage006/foobar.idr
Normal file
7
tests/idris2/coverage006/foobar.idr
Normal file
@ -0,0 +1,7 @@
|
||||
foo : (pf : Nat -> Either (S Z = Z) (Z = S Z)) -> Z = S Z
|
||||
foo pf =
|
||||
let baz : Z = S Z
|
||||
baz with (pf 0)
|
||||
baz | (Left Refl) impossible
|
||||
baz | (Right pf') = pf'
|
||||
in baz
|
2
tests/idris2/coverage006/input
Normal file
2
tests/idris2/coverage006/input
Normal file
@ -0,0 +1,2 @@
|
||||
:total foo
|
||||
:q
|
3
tests/idris2/coverage006/run
Executable file
3
tests/idris2/coverage006/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --no-banner foobar.idr < input
|
||||
|
||||
rm -rf build
|
Loading…
Reference in New Issue
Block a user