test passing !
This commit is contained in:
parent
a3deccf352
commit
7eed9b1856
@ -31,7 +31,7 @@ function lamby (var accu : (record st : string ; acc : int end) ; var i : int )
|
|||||||
accu.st := accu.st ^ "to" ;
|
accu.st := accu.st ^ "to" ;
|
||||||
} with accu
|
} with accu
|
||||||
|
|
||||||
function for_collection (var nee : unit; var nuu : unit) : (int * string) is block {
|
function for_collection_ (var nee : unit; var nuu : unit) : (int * string) is block {
|
||||||
var acc : int := 0 ;
|
var acc : int := 0 ;
|
||||||
var st : string := "to" ;
|
var st : string := "to" ;
|
||||||
var mylist : list(int) := list 1 ; 1 ; 1 end ;
|
var mylist : list(int) := list 1 ; 1 ; 1 end ;
|
||||||
@ -46,7 +46,7 @@ function for_collection (var nee : unit; var nuu : unit) : (int * string) is blo
|
|||||||
|
|
||||||
} with (folded_record.acc , folded_record.st)
|
} with (folded_record.acc , folded_record.st)
|
||||||
|
|
||||||
function for_collection_ (var nee : unit; var nuu : unit) : (int * string) is block {
|
function for_collection (var nee : unit) : (int * string) is block {
|
||||||
var acc : int := 0 ;
|
var acc : int := 0 ;
|
||||||
var st : string := "to" ;
|
var st : string := "to" ;
|
||||||
// var toto : (string * string) := ("foo","bar") ;
|
// var toto : (string * string) := ("foo","bar") ;
|
||||||
@ -60,7 +60,7 @@ function for_collection_ (var nee : unit; var nuu : unit) : (int * string) is bl
|
|||||||
st := st^"to" ;
|
st := st^"to" ;
|
||||||
end
|
end
|
||||||
|
|
||||||
} with acc
|
} with (acc, st)
|
||||||
|
|
||||||
function dummy (const n : nat) : nat is block {
|
function dummy (const n : nat) : nat is block {
|
||||||
while (False) block { skip }
|
while (False) block { skip }
|
||||||
|
@ -670,6 +670,11 @@ let loop () : unit result =
|
|||||||
let make_expected = fun n -> e_int (n * (n + 1) / 2) in
|
let make_expected = fun n -> e_int (n * (n + 1) / 2) in
|
||||||
expect_eq_n_pos_mid program "for_sum" make_input make_expected
|
expect_eq_n_pos_mid program "for_sum" make_input make_expected
|
||||||
in
|
in
|
||||||
|
let%bind () =
|
||||||
|
let input = e_unit () in
|
||||||
|
let expected = e_pair (e_int 3) (e_string "totototo") in
|
||||||
|
expect_eq program "for_collection" input expected
|
||||||
|
in
|
||||||
ok ()
|
ok ()
|
||||||
|
|
||||||
(* Don't know how to assert parse error happens in this test framework
|
(* Don't know how to assert parse error happens in this test framework
|
||||||
|
Loading…
Reference in New Issue
Block a user