test passing !

This commit is contained in:
Lesenechal Remi 2019-10-27 11:47:17 +01:00
parent a3deccf352
commit 7eed9b1856
2 changed files with 8 additions and 3 deletions

View File

@ -31,7 +31,7 @@ function lamby (var accu : (record st : string ; acc : int end) ; var i : int )
accu.st := accu.st ^ "to" ;
} 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 st : string := "to" ;
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)
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 st : string := "to" ;
// 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" ;
end
} with acc
} with (acc, st)
function dummy (const n : nat) : nat is block {
while (False) block { skip }

View File

@ -670,6 +670,11 @@ let loop () : unit result =
let make_expected = fun n -> e_int (n * (n + 1) / 2) in
expect_eq_n_pos_mid program "for_sum" make_input make_expected
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 ()
(* Don't know how to assert parse error happens in this test framework