diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-11-17 16:01:40 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-11-17 16:01:40 +0000 |
commit | 43e7140a99ca9e1656f546394c5550c43b0450db (patch) | |
tree | a6cfd886e9e9c5ed500d60485b4c93661c851dd2 /testsuite/tests | |
parent | ad35781920eb7087b93b28dc89bc12b4a4c9c398 (diff) | |
download | haskell-43e7140a99ca9e1656f546394c5550c43b0450db.tar.gz |
Update test suite following the removal of the default grouping
clause from the SQL-like comprehension notation
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/deSugar/should_run/dsrun017.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_run/dsrun022.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_run/mc01.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_run/mc08.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/mc16.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/read062.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/readFail043.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/readFail043.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rename/should_compile/T3901.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/rename/should_compile/mc11.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/mc20.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/mc20.stderr | 11 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/tcfail190.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/tcfail190.stderr | 11 |
15 files changed, 47 insertions, 36 deletions
diff --git a/testsuite/tests/deSugar/should_run/dsrun017.hs b/testsuite/tests/deSugar/should_run/dsrun017.hs index 877db7823c..7a8d16efe5 100644 --- a/testsuite/tests/deSugar/should_run/dsrun017.hs +++ b/testsuite/tests/deSugar/should_run/dsrun017.hs @@ -1,13 +1,13 @@ --- Tests grouping WITH a by clause but WITHOUT a using clause +-- Tests grouping WITH a by clause {-# OPTIONS_GHC -XTransformListComp #-} module Main where -import GHC.Exts(the) +import GHC.Exts(the,groupWith) main = putStrLn (show output) where output = [ (the dept, sum salary, name) | (dept, salary, name) <- [("A", 1, "Bob"), ("B", 2, "Fred"), ("A", 5, "Jim"), ("A", 9, "Jim")] - , then group by dept ]
\ No newline at end of file + , then group by dept using groupWith ]
\ No newline at end of file diff --git a/testsuite/tests/deSugar/should_run/dsrun022.hs b/testsuite/tests/deSugar/should_run/dsrun022.hs index dbbd906ce8..6119675e98 100644 --- a/testsuite/tests/deSugar/should_run/dsrun022.hs +++ b/testsuite/tests/deSugar/should_run/dsrun022.hs @@ -4,7 +4,7 @@ module Main where -import GHC.Exts(sortWith, the) +import GHC.Exts(sortWith, the, groupWith) employees = [ ("Simon", "MS", 80) , ("Erik", "MS", 100) @@ -16,7 +16,7 @@ main = putStrLn (show can_still_use_group_function) >> putStrLn (show output) where output = [ (the dept, map sum salary, (show x) ++ " and " ++ (show y)) | (name, dept, salary) <- employees - , then group by dept + , then group by dept using groupWith , x <- [1, 2, 3] , y <- [4, 5, 6] , then sortWith by sum salary diff --git a/testsuite/tests/deSugar/should_run/mc01.hs b/testsuite/tests/deSugar/should_run/mc01.hs index cf5ca1a0e9..63db170197 100644 --- a/testsuite/tests/deSugar/should_run/mc01.hs +++ b/testsuite/tests/deSugar/should_run/mc01.hs @@ -4,7 +4,7 @@ module Main where -import GHC.Exts(sortWith, the) +import GHC.Exts(sortWith, the, groupWith) employees = [ ("Simon", "MS", 80) , ("Erik", "MS", 100) @@ -16,7 +16,7 @@ main = putStrLn (show can_still_use_group_function) >> putStrLn (show output) where output = [ (the dept, map sum salary, (show x) ++ " and " ++ (show y)) | (name, dept, salary) <- employees - , then group by dept + , then group by dept using groupWith , x <- [1, 2, 3] , y <- [4, 5, 6] , then sortWith by sum salary diff --git a/testsuite/tests/deSugar/should_run/mc08.hs b/testsuite/tests/deSugar/should_run/mc08.hs index 24dd3beb4c..d146bf909f 100644 --- a/testsuite/tests/deSugar/should_run/mc08.hs +++ b/testsuite/tests/deSugar/should_run/mc08.hs @@ -1,13 +1,13 @@ --- Tests grouping WITH a by clause but WITHOUT a using clause +-- Tests grouping WITH a by clause {-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-} module Main where -import GHC.Exts(the) +import GHC.Exts(the, groupWith) main = putStrLn (show output) where output = [ (the dept, sum salary, name) | (dept, salary, name) <- [("A", 1, "Bob"), ("B", 2, "Fred"), ("A", 5, "Jim"), ("A", 9, "Jim")] - , then group by dept ] + , then group by dept using groupWith] diff --git a/testsuite/tests/parser/should_compile/mc16.hs b/testsuite/tests/parser/should_compile/mc16.hs index 3f80c04abb..4ff2e169a1 100644 --- a/testsuite/tests/parser/should_compile/mc16.hs +++ b/testsuite/tests/parser/should_compile/mc16.hs @@ -9,7 +9,7 @@ foo = [ () | x <- [1..10] , then take 5 , then sortWith by x - , then group by x + , then group by x using groupWith , then group using inits , then group by x using groupWith ] diff --git a/testsuite/tests/parser/should_compile/read062.hs b/testsuite/tests/parser/should_compile/read062.hs index 4d57585c10..d324111de5 100644 --- a/testsuite/tests/parser/should_compile/read062.hs +++ b/testsuite/tests/parser/should_compile/read062.hs @@ -9,7 +9,7 @@ foo = [ () | x <- [1..10]
, then take 5
, then sortWith by x
- , then group by x
+ , then group by x using groupWith
, then group using inits
, then group by x using groupWith
]
diff --git a/testsuite/tests/parser/should_fail/readFail043.hs b/testsuite/tests/parser/should_fail/readFail043.hs index e6304bea9a..65e00b36bd 100644 --- a/testsuite/tests/parser/should_fail/readFail043.hs +++ b/testsuite/tests/parser/should_fail/readFail043.hs @@ -7,7 +7,7 @@ import GHC.Exts foo = [ ()
| x <- [1..10]
- , then group by x
+ , then group by x using groupWith
, then group by x using groupWith
, then group using inits
]
diff --git a/testsuite/tests/parser/should_fail/readFail043.stderr b/testsuite/tests/parser/should_fail/readFail043.stderr index 1b2b1abc15..b132bef957 100644 --- a/testsuite/tests/parser/should_fail/readFail043.stderr +++ b/testsuite/tests/parser/should_fail/readFail043.stderr @@ -7,6 +7,8 @@ readFail043.hs:10:20: Not in scope: `by' readFail043.hs:10:23: Not in scope: `x' +readFail043.hs:10:25: Not in scope: `using' + readFail043.hs:11:9: Unexpected transform statement in a list comprehension Use -XTransformListComp diff --git a/testsuite/tests/rename/should_compile/T3901.hs b/testsuite/tests/rename/should_compile/T3901.hs index 39b521977b..71944a4142 100644 --- a/testsuite/tests/rename/should_compile/T3901.hs +++ b/testsuite/tests/rename/should_compile/T3901.hs @@ -2,13 +2,15 @@ module T3901 where +import GHC.Exts (groupWith) + data Rec = Rec {a :: Int} deriving (Show) -recs1 = [a | Rec {a=a} <- [Rec 1], then group by a] +recs1 = [a | Rec {a=a} <- [Rec 1], then group by a using groupWith] -recs2 = [a | Rec {a} <- [Rec 1], then group by a] +recs2 = [a | Rec {a} <- [Rec 1], then group by a using groupWith] -recs3 = [a | Rec {..} <- [Rec 1], then group by a] +recs3 = [a | Rec {..} <- [Rec 1], then group by a using groupWith] recs4 :: [[Int]] -recs4 = [a | Rec {..} <- [Rec 1], then group by a] +recs4 = [a | Rec {..} <- [Rec 1], then group by a using groupWith] diff --git a/testsuite/tests/rename/should_compile/mc11.hs b/testsuite/tests/rename/should_compile/mc11.hs index 250e587a16..b45fdc41f4 100644 --- a/testsuite/tests/rename/should_compile/mc11.hs +++ b/testsuite/tests/rename/should_compile/mc11.hs @@ -2,13 +2,15 @@ module T3901 where +import GHC.Exts (groupWith) + data Rec = Rec {a :: Int} deriving (Show) -recs1 = [a | Rec {a=a} <- [Rec 1], then group by a] +recs1 = [a | Rec {a=a} <- [Rec 1], then group by a using groupWith] -recs2 = [a | Rec {a} <- [Rec 1], then group by a] +recs2 = [a | Rec {a} <- [Rec 1], then group by a using groupWith] -recs3 = [a | Rec {..} <- [Rec 1], then group by a] +recs3 = [a | Rec {..} <- [Rec 1], then group by a using groupWith] recs4 :: [[Int]] -recs4 = [a | Rec {..} <- [Rec 1], then group by a] +recs4 = [a | Rec {..} <- [Rec 1], then group by a using groupWith] diff --git a/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs b/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs index 34a5e4ebac..9f253a7807 100644 --- a/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs +++ b/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs @@ -27,7 +27,6 @@ import Control.Exception.Base import Control.Monad import Control.Monad.Fix -import Control.Monad.Group import Control.Monad.Instances import Control.Monad.Zip diff --git a/testsuite/tests/typecheck/should_fail/mc20.hs b/testsuite/tests/typecheck/should_fail/mc20.hs index 4dd0fe2fe5..efdfd5b453 100644 --- a/testsuite/tests/typecheck/should_fail/mc20.hs +++ b/testsuite/tests/typecheck/should_fail/mc20.hs @@ -1,13 +1,15 @@ --- Checks that the ordering constraint on the implicit groupWith is respected +-- Checks that the ordering constraint on the groupWith function is respected {-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-} module ShouldFail where +import GHC.Exts (groupWith) + data Unorderable = Gnorf | Pinky | Brain foo = [ () | x <- [Gnorf, Brain] - , then group by x + , then group by x using groupWith ] diff --git a/testsuite/tests/typecheck/should_fail/mc20.stderr b/testsuite/tests/typecheck/should_fail/mc20.stderr index 1214b6ac17..ee9bb4b39f 100644 --- a/testsuite/tests/typecheck/should_fail/mc20.stderr +++ b/testsuite/tests/typecheck/should_fail/mc20.stderr @@ -1,8 +1,9 @@ -mc20.hs:12:9: +mc20.hs:14:31: No instance for (Ord Unorderable) - arising from a use of `Control.Monad.Group.mgroupWith' + arising from a use of `groupWith' Possible fix: add an instance declaration for (Ord Unorderable) - In the expression: Control.Monad.Group.mgroupWith - In a stmt of a monad comprehension: then group by x - In the expression: [() | x <- [Gnorf, Brain], then group by x] + In the expression: groupWith + In a stmt of a monad comprehension: then group by x using groupWith + In the expression: + [() | x <- [Gnorf, Brain], then group by x using groupWith] diff --git a/testsuite/tests/typecheck/should_fail/tcfail190.hs b/testsuite/tests/typecheck/should_fail/tcfail190.hs index 7cc768af65..0e81b190d3 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail190.hs +++ b/testsuite/tests/typecheck/should_fail/tcfail190.hs @@ -1,13 +1,15 @@ --- Checks that the ordering constraint on the implicit groupWith is respected +-- Checks that the ordering constraint on the groupWith function is respected {-# OPTIONS_GHC -XTransformListComp #-} module ShouldFail where +import GHC.Exts (groupWith) + data Unorderable = Gnorf | Pinky | Brain foo = [ () | x <- [Gnorf, Brain] - , then group by x + , then group by x using groupWith ] diff --git a/testsuite/tests/typecheck/should_fail/tcfail190.stderr b/testsuite/tests/typecheck/should_fail/tcfail190.stderr index a2e1034162..a6469e72d7 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail190.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail190.stderr @@ -1,8 +1,9 @@ -tcfail190.hs:12:9: +tcfail190.hs:14:31: No instance for (Ord Unorderable) - arising from a use of `Control.Monad.Group.mgroupWith' + arising from a use of `groupWith' Possible fix: add an instance declaration for (Ord Unorderable) - In the expression: Control.Monad.Group.mgroupWith - In a stmt of a list comprehension: then group by x - In the expression: [() | x <- [Gnorf, Brain], then group by x] + In the expression: groupWith + In a stmt of a list comprehension: then group by x using groupWith + In the expression: + [() | x <- [Gnorf, Brain], then group by x using groupWith] |