diff options
author | Nadrieril | 2024-05-27 17:33:56 +0200 |
---|---|---|
committer | Nadrieril | 2024-05-28 11:36:31 +0200 |
commit | c81c96f20b1dbf428a9ed42e83b910e798e1a225 (patch) | |
tree | b01e01eb4bcec7112399647943047bed3b58cad1 /tests/src | |
parent | 9cc69020773cc77965a6faa6f0d46f179de3d8b8 (diff) |
Add some tests
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/infinite-loop.rs | 11 | ||||
-rw-r--r-- | tests/src/issue-194-recursive-struct-projector.rs | 16 | ||||
-rw-r--r-- | tests/src/matches.rs | 10 |
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/src/infinite-loop.rs b/tests/src/infinite-loop.rs new file mode 100644 index 00000000..906fc1fa --- /dev/null +++ b/tests/src/infinite-loop.rs @@ -0,0 +1,11 @@ +//@ [coq,fstar,lean] skip +//@ [coq,fstar] aeneas-args=-use-fuel +//@ [coq,fstar] subdir=misc +// FIXME: make it work +fn bar() {} + +fn foo() { + loop { + bar() + } +} diff --git a/tests/src/issue-194-recursive-struct-projector.rs b/tests/src/issue-194-recursive-struct-projector.rs new file mode 100644 index 00000000..9ebdc2bc --- /dev/null +++ b/tests/src/issue-194-recursive-struct-projector.rs @@ -0,0 +1,16 @@ +//@ [coq,fstar] subdir=misc +struct AVLNode<T> { + value: T, + left: AVLTree<T>, + right: AVLTree<T>, +} + +type AVLTree<T> = Option<Box<AVLNode<T>>>; + +fn get_val<T>(x: AVLNode<T>) -> T { + x.value +} + +fn get_left<T>(x: AVLNode<T>) -> AVLTree<T> { + x.left +} diff --git a/tests/src/matches.rs b/tests/src/matches.rs new file mode 100644 index 00000000..5710a604 --- /dev/null +++ b/tests/src/matches.rs @@ -0,0 +1,10 @@ +//@ [coq] skip +//@ [coq,fstar] subdir=misc +//^ note: coq gives "invalid notation for pattern" +fn match_u32(x: u32) -> u32 { + match x { + 0 => 0, + 1 => 1, + _ => 2, + } +} |