From c39e23e8c234a1b91c80f0a5d1d1a60aa9d70753 Mon Sep 17 00:00:00 2001 From: itchyny Date: Sat, 20 May 2017 10:23:11 +0900 Subject: [PATCH] add tests for list comprehension --- test/list/comprehension_multi_line2.in.hs | 9 +++++++++ test/list/comprehension_multi_line2.out.hs | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/list/comprehension_multi_line2.in.hs create mode 100644 test/list/comprehension_multi_line2.out.hs diff --git a/test/list/comprehension_multi_line2.in.hs b/test/list/comprehension_multi_line2.in.hs new file mode 100644 index 0000000..390bcdf --- /dev/null +++ b/test/list/comprehension_multi_line2.in.hs @@ -0,0 +1,9 @@ +z = (x, y) +where x = [ n * n +| n <- [1..] +, odd n +, isPrime n ] +y = [ n * n +| n <- [1..] +, even n +, isPrime (n `div` 2) ] diff --git a/test/list/comprehension_multi_line2.out.hs b/test/list/comprehension_multi_line2.out.hs new file mode 100644 index 0000000..13386cb --- /dev/null +++ b/test/list/comprehension_multi_line2.out.hs @@ -0,0 +1,9 @@ +z = (x, y) + where x = [ n * n + | n <- [1..] + , odd n + , isPrime n ] + y = [ n * n + | n <- [1..] + , even n + , isPrime (n `div` 2) ]