mirror of
https://github.com/Kindelia/Kind2.git
synced 2024-09-11 07:15:45 +03:00
tests: added tests
This commit is contained in:
parent
77af124c20
commit
663c87ffc0
@ -1 +1,2 @@
|
|||||||
"ata"
|
'ata'
|
||||||
|
|
||||||
|
3
crates/kind-tests/suite/issues/eval/ISSUE-472.golden
Normal file
3
crates/kind-tests/suite/issues/eval/ISSUE-472.golden
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
'
|
||||||
|
'
|
||||||
|
|
23
crates/kind-tests/suite/issues/eval/ISSUE-472.kind2
Normal file
23
crates/kind-tests/suite/issues/eval/ISSUE-472.kind2
Normal 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))
|
1
crates/kind-tests/suite/issues/run/CallStr.golden
Normal file
1
crates/kind-tests/suite/issues/run/CallStr.golden
Normal file
@ -0,0 +1 @@
|
|||||||
|
"ata"
|
3
crates/kind-tests/suite/issues/run/CallStr.kind2
Normal file
3
crates/kind-tests/suite/issues/run/CallStr.kind2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Main : U60 {
|
||||||
|
"ata"
|
||||||
|
}
|
2
crates/kind-tests/suite/issues/run/ISSUE-472.golden
Normal file
2
crates/kind-tests/suite/issues/run/ISSUE-472.golden
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
"
|
||||||
|
"
|
23
crates/kind-tests/suite/issues/run/ISSUE-472.kind2
Normal file
23
crates/kind-tests/suite/issues/run/ISSUE-472.kind2
Normal 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))
|
@ -115,6 +115,18 @@ fn test_eval() -> Result<(), Error> {
|
|||||||
#[timeout(15000)]
|
#[timeout(15000)]
|
||||||
fn test_eval_issues() -> Result<(), Error> {
|
fn test_eval_issues() -> Result<(), Error> {
|
||||||
test_kind2(Path::new("./suite/issues/eval"), |path, session| {
|
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 entrypoints = vec!["Main".to_string()];
|
||||||
let check = driver::erase_book(session, path, entrypoints)
|
let check = driver::erase_book(session, path, entrypoints)
|
||||||
.map(|file| driver::compile_book_to_hvm(file, false))
|
.map(|file| driver::compile_book_to_hvm(file, false))
|
||||||
|
Loading…
Reference in New Issue
Block a user