Add test of noNewtype

This commit is contained in:
Christian Rasmussen 2020-04-29 01:15:48 +02:00
parent 84e431f495
commit 69aff544b6
5 changed files with 29 additions and 1 deletions

View File

@ -98,7 +98,7 @@ chezTests : List String
chezTests
= ["chez001", "chez002", "chez003", "chez004", "chez005", "chez006",
"chez007", "chez008", "chez009", "chez010", "chez011", "chez012",
"chez013", "chez014", "chez015", "chez016",
"chez013", "chez014", "chez015", "chez016", "chez017",
"reg001"]
ideModeTests : List String

View File

@ -0,0 +1,19 @@
module Main
data Foo : Type where
MkFoo : String -> Foo
data Bar : Type where
[noNewtype]
MkBar : String -> Bar
-- This code rely on the fact that `putStr` calls the Chez function `display`,
-- which allows any value to be printed. This will expose the internal
-- structure of each data type.
main : IO ()
main = do
putStr (believe_me (MkFoo "foo"))
putChar '\n'
putStr (believe_me (MkBar "bar"))
putChar '\n'

View File

@ -0,0 +1,4 @@
foo
#(0 bar)
1/1: Building Main (Main.idr)
Main> Main> Bye for now!

2
tests/chez/chez017/input Normal file
View File

@ -0,0 +1,2 @@
:exec main
:q

3
tests/chez/chez017/run Executable file
View File

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