mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-11-24 12:54:28 +03:00
Adding missing test files
This commit is contained in:
parent
8a1a4ad56d
commit
2487c30232
15
tests/idris2/coverage003/Cover.idr
Normal file
15
tests/idris2/coverage003/Cover.idr
Normal file
@ -0,0 +1,15 @@
|
||||
foo : (Nat, Nat) -> Nat
|
||||
foo (Z, Z) = Z
|
||||
|
||||
bar : {a : _} -> a -> Nat
|
||||
bar Z = Z
|
||||
bar (S _) = S Z
|
||||
|
||||
cty : (a : Type) -> a -> Nat
|
||||
cty Nat Z = Z
|
||||
cty Nat (S _) = S Z
|
||||
cty _ x = S (S Z)
|
||||
|
||||
badBar : a -> Nat
|
||||
badBar Z = Z
|
||||
badBar (S _) = S Z
|
11
tests/idris2/coverage003/expected
Normal file
11
tests/idris2/coverage003/expected
Normal file
@ -0,0 +1,11 @@
|
||||
1/1: Building Cover (Cover.idr)
|
||||
Cover.idr:14:1--14:8:While processing left hand side of Main.badBar at Cover.idr:14:1--15:1:
|
||||
Can't match on Z as it has a polymorphic type
|
||||
Welcome to Idris 2 version 0.0. Enjoy yourself!
|
||||
Main> Main.foo:
|
||||
foo (Z, S _)
|
||||
foo (S _, _)
|
||||
Main> Main.bar:
|
||||
bar _
|
||||
Main> Main.cty: All cases covered
|
||||
Main> Bye for now!
|
4
tests/idris2/coverage003/input
Normal file
4
tests/idris2/coverage003/input
Normal file
@ -0,0 +1,4 @@
|
||||
:missing foo
|
||||
:missing bar
|
||||
:missing cty
|
||||
:q
|
3
tests/idris2/coverage003/run
Executable file
3
tests/idris2/coverage003/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 Cover.idr < input
|
||||
|
||||
rm -rf build
|
12
tests/idris2/coverage004/Cover.idr
Normal file
12
tests/idris2/coverage004/Cover.idr
Normal file
@ -0,0 +1,12 @@
|
||||
data Foo : Type -> Type where
|
||||
IsNat : Foo Nat
|
||||
IsBool : Foo Bool
|
||||
|
||||
okay : a -> Foo a -> Bool
|
||||
okay Z IsNat = False
|
||||
okay True IsBool = True
|
||||
|
||||
bad : a -> Foo a -> Bool
|
||||
bad Z IsNat = False
|
||||
bad True IsBool = True
|
||||
bad (Just 0) _ = False
|
8
tests/idris2/coverage004/expected
Normal file
8
tests/idris2/coverage004/expected
Normal file
@ -0,0 +1,8 @@
|
||||
1/1: Building Cover (Cover.idr)
|
||||
Cover.idr:12:1--12:5:While processing left hand side of Main.bad at Cover.idr:12:1--13:1:
|
||||
Can't match on Just (fromInteger 0) as it has a polymorphic type
|
||||
Welcome to Idris 2 version 0.0. Enjoy yourself!
|
||||
Main> Main.okay:
|
||||
okay (S _) IsNat
|
||||
okay False IsBool
|
||||
Main> Bye for now!
|
2
tests/idris2/coverage004/input
Normal file
2
tests/idris2/coverage004/input
Normal file
@ -0,0 +1,2 @@
|
||||
:missing okay
|
||||
:q
|
3
tests/idris2/coverage004/run
Executable file
3
tests/idris2/coverage004/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 Cover.idr < input
|
||||
|
||||
rm -rf build
|
Loading…
Reference in New Issue
Block a user