mirror of
https://github.com/AdaCore/why3.git
synced 2026-02-12 12:34:55 -08:00
26 lines
468 B
Plaintext
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
|
|
|