From 409a32b192232a917d010944e90fbf611c1ddc44 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Mon, 27 Dec 2021 15:05:59 +0000 Subject: [PATCH] Test for equality on very long linked lists --- compiler/test_gen/src/gen_compare.rs | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/compiler/test_gen/src/gen_compare.rs b/compiler/test_gen/src/gen_compare.rs index 705d944073..65fe0a252e 100644 --- a/compiler/test_gen/src/gen_compare.rs +++ b/compiler/test_gen/src/gen_compare.rs @@ -372,6 +372,39 @@ fn eq_linked_list_false() { ); } +#[test] +#[cfg(any(feature = "gen-wasm"))] +fn eq_linked_list_long() { + assert_evals_to!( + indoc!( + r#" + app "test" provides [ main ] to "./platform" + + LinkedList a : [ Nil, Cons a (LinkedList a) ] + + prependOnes = \n, tail -> + if n == 0 then + tail + else + prependOnes (n-1) (Cons 1 tail) + + main = + n = 100_000 + + x : LinkedList I64 + x = prependOnes n (Cons 999 Nil) + + y : LinkedList I64 + y = prependOnes n (Cons 123 Nil) + + y == x + "# + ), + false, + bool + ); +} + #[test] #[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn eq_nullable_expr() {