Add empty map patch test
This commit is contained in:
parent
49ffe00466
commit
62377135c4
@ -29,6 +29,10 @@ function patch_ (var m: foobar) : foobar is block {
|
||||
patch m with map [0 -> 5; 1 -> 6; 2 -> 7]
|
||||
} with m
|
||||
|
||||
function patch_empty (var m : foobar) : foobar is block {
|
||||
patch m with map []
|
||||
} with m
|
||||
|
||||
function size_ (const m : foobar) : nat is
|
||||
block {skip} with (size(m))
|
||||
|
||||
|
@ -14,6 +14,9 @@ let rm (m : foobar) : foobar = Map.remove 42 m
|
||||
(* Dummy test so that we can add the same test for PascaLIGO *)
|
||||
let patch_ (m : foobar) : foobar = Map.literal [ (0, 5) ; (1, 6) ; (2, 7) ]
|
||||
|
||||
(* Second dummy test, see above *)
|
||||
let patch_empty (m : foobar) : foobar = Map.literal [ (0, 0) ; (1, 1) ; (2, 2) ]
|
||||
|
||||
let size_ (m : foobar) : nat = Map.size m
|
||||
|
||||
let gf (m : foobar) : int = Map.find 23 m
|
||||
|
@ -416,6 +416,11 @@ let map_ type_f path : unit result =
|
||||
let expected = ez [(0, 5) ; (1, 6) ; (2, 7)] in
|
||||
expect_eq program "patch_" input expected
|
||||
in
|
||||
let%bind () =
|
||||
let input = ez [(0,0) ; (1,1) ; (2,2)] in
|
||||
let expected = ez [(0,0) ; (1,1) ; (2,2)] in
|
||||
expect_eq program "patch_empty" input expected
|
||||
in
|
||||
let%bind () =
|
||||
let make_input = fun n -> ez List.(map (fun x -> (x, x)) @@ range n) in
|
||||
let make_expected = e_nat in
|
||||
|
Loading…
Reference in New Issue
Block a user