Add coverage006 test

This commit is contained in:
Edwin Brady 2020-03-18 14:39:59 +00:00
parent 22febdf7ff
commit fbff80545d
5 changed files with 35 additions and 0 deletions

View 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"

View File

@ -0,0 +1,3 @@
1/1: Building foobar (foobar.idr)
Main> Main.foo is total
Main> Bye for now!

View 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

View File

@ -0,0 +1,2 @@
:total foo
:q

3
tests/idris2/coverage006/run Executable file
View File

@ -0,0 +1,3 @@
$1 --no-banner foobar.idr < input
rm -rf build