tests: added tests

This commit is contained in:
felipegchi 2023-01-16 09:26:21 -03:00
parent 77af124c20
commit 663c87ffc0
8 changed files with 69 additions and 1 deletions

View File

@ -1 +1,2 @@
"ata"
'ata'

View File

@ -0,0 +1,3 @@
'
'

View File

@ -0,0 +1,23 @@
Char : Type
Char = U60
#inline
String.new_line : (String)
String.new_line = (String.pure (Char.newline))
Main : _
Main = String.new_line
#inline
Char.newline : (Char)
Char.newline = 10
#derive[match]
type String {
nil
cons (head: (Char)) (tail: (String))
}
#inline
String.pure (x: (Char)) : (String)
String.pure x = (String.cons x (String.nil))

View File

@ -0,0 +1 @@
"ata"

View File

@ -0,0 +1,3 @@
Main : U60 {
"ata"
}

View File

@ -0,0 +1,2 @@
"
"

View File

@ -0,0 +1,23 @@
Char : Type
Char = U60
#inline
String.new_line : (String)
String.new_line = (String.pure (Char.newline))
Main : _
Main = String.new_line
#inline
Char.newline : (Char)
Char.newline = 10
#derive[match]
type String {
nil
cons (head: (Char)) (tail: (String))
}
#inline
String.pure (x: (Char)) : (String)
String.pure x = (String.cons x (String.nil))

View File

@ -115,6 +115,18 @@ fn test_eval() -> Result<(), Error> {
#[timeout(15000)]
fn test_eval_issues() -> Result<(), Error> {
test_kind2(Path::new("./suite/issues/eval"), |path, session| {
let check = driver::desugar_book(session, path)
.map(|file| driver::eval_in_checker(&file));
check.ok().map(|x| x.0)
})?;
Ok(())
}
#[test]
#[timeout(15000)]
fn test_run_issues() -> Result<(), Error> {
test_kind2(Path::new("./suite/issues/run"), |path, session| {
let entrypoints = vec!["Main".to_string()];
let check = driver::erase_book(session, path, entrypoints)
.map(|file| driver::compile_book_to_hvm(file, false))