Forgot to add some test files!

This commit is contained in:
Edwin Brady 2020-05-21 17:22:30 +01:00
parent 941c8b1ab5
commit 02ac3c9945
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,5 @@
1/1: Building partial (partial.idr)
partial.idr:5:1--7:1:foo is not covering. Missing cases:
foo Nothing
partial.idr:13:1--15:1:qsortBad is not total:
possibly not terminating due to recursive path Main.qsortBad -> Main.qsortBad -> Main.qsortBad

View File

@ -0,0 +1,29 @@
import Data.List
-- %default total
total
foo : Maybe a -> a
foo (Just x) = x
total
bar : %World -> ()
bar %MkWorld = ()
total
qsortBad : Ord a => List a -> List a
qsortBad [] = []
qsortBad (x :: xs)
= qsortBad (filter (< x) xs) ++ x :: qsortBad (filter (> x) xs)
total
qsort : Ord a => List a -> List a
qsort [] = []
qsort (x :: xs)
= qsort (assert_smaller (x :: xs) (filter (< x) xs)) ++
x :: qsort (assert_smaller (x :: xs) (filter (> x) xs))
partial
main : IO ()
main = do let x = foo Nothing
printLn (the Int x)

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

@ -0,0 +1,3 @@
$1 --no-banner partial.idr --check
rm -rf build