Files
why3/examples/tests/stack-test.mlw
2018-06-15 16:45:58 +02:00

26 lines
468 B
Plaintext

module Test
use int.Int
use list.List
use stack.Stack
let test0 () =
let s = Stack.create () : Stack.t 'a in
assert { s.elts = Nil };
let b = Stack.is_empty s in
assert { b = True };
let n = Stack.length s in
assert { n = 0 }
let test1 () raises { Empty }
= let s = Stack.create () in
Stack.push 1 s;
let x = Stack.top s in assert { x = 1 };
Stack.push 2 s;
let x = Stack.top s in assert { x = 2 };
()
end