[Git][ghc/ghc][wip/or-pats] Update tests

David (@knothed) gitlab at gitlab.haskell.org
Thu Jun 1 09:12:12 UTC 2023



David pushed to branch wip/or-pats at Glasgow Haskell Compiler / GHC


Commits:
3ea8d86e by David Knothe at 2023-06-01T11:12:07+02:00
Update tests

- - - - -


4 changed files:

- testsuite/tests/deSugar/should_run/Or4.hs
- testsuite/tests/parser/should_fail/Or1.hs
- testsuite/tests/parser/should_fail/Or2.hs
- testsuite/tests/typecheck/should_fail/Or3.hs


Changes:

=====================================
testsuite/tests/deSugar/should_run/Or4.hs
=====================================
@@ -19,20 +19,20 @@ main = do
 f1 x = case x of
   3 -> 1
   4 -> 2
-  (one of 3,4,5) -> 3
+  (one of 3;4;5) -> 3
 
 f2 y = case y of
-  (one of _:2:_, 1:_) | length y /= 2 -> 1
-  (one of [1,2], 1:3:_)-> 2
-  (one of _, _) -> 3
+  (one of _:2:_; 1:_) | length y /= 2 -> 1
+  (one of [1,2]; 1:3:_)-> 2
+  (one of _; _) -> 3
 
 f3 :: (Eq a, Show a) => a -> a -> Bool
-f3 a (one of (== a) -> True, show -> "8") = True
+f3 a (one of (== a) -> True; show -> "8") = True
 f3 _ _ = False
 
-a3 = (\(one of 1, 2) -> 3) 1
-a4 = (\(one of Left 0, Right 1) -> True) (Right 1)
-a5 = (\(one of (one of [1], [2, _]), (one of [3, _, _], [4, _, _, _])) -> True) [4, undefined, undefined, undefined]
+a3 = (\(one of 1; 2) -> 3) 1
+a4 = (\(one of Left 0; Right 1) -> True) (Right 1)
+a5 = (\(one of (one of [1]; [2, _]); (one of [3, _, _]; [4, _, _, _])) -> True) [4, undefined, undefined, undefined]
 a6 = (\(one of 1, 2, 3) -> False) 3
 
 backtrack :: String


=====================================
testsuite/tests/parser/should_fail/Or1.hs
=====================================
@@ -3,4 +3,4 @@ module Main where
 main = print $ h 1
 
 h one = case one of
-  (one of 2, 3) -> True
\ No newline at end of file
+  (one of 2; 3) -> True
\ No newline at end of file


=====================================
testsuite/tests/parser/should_fail/Or2.hs
=====================================
@@ -6,4 +6,4 @@ main = case 3 of
   (one of 4) -> False
 
 g x = case x of
-  one of 4, 5 -> False
+  one of 4; 5 -> False


=====================================
testsuite/tests/typecheck/should_fail/Or3.hs
=====================================
@@ -16,12 +16,12 @@ data GADT a where
     IsInt2 :: GADT Int
 
 foo :: a -> GADT a -> a
-foo x (one of IsInt1 {}, IsInt2 {}) = x + 1
+foo x (one of IsInt1 {}; IsInt2 {}) = x + 1
 
 f x = case x of
-  (one of Left a, Right a) -> a
+  (one of Left a; Right a) -> a
 
 g x = case x of
-  (one of _, (one of _, x)) -> x
+  (one of _; (one of _; x)) -> x
 
 main = print $ foo 3 IsInt1
\ No newline at end of file



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3ea8d86e361c09427aa1f9d4a99c9a36346e755a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3ea8d86e361c09427aa1f9d4a99c9a36346e755a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230601/8c8d8bf3/attachment-0001.html>


More information about the ghc-commits mailing list