Skip to content

Commit 1f0d31f

Browse files
committed
Add known broken tests for import placement
1 parent 0b74792 commit 1f0d31f

25 files changed

+569
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{-# OPTIONS_GHC -Wall #-}
2+
{-# LANGUAGE OverloadedStrings #-}
3+
{-# LANGUAGE RecordWildCards,
4+
OverloadedStrings #-}
5+
{-# OPTIONS_GHC -Wall,
6+
-Wno-unused-imports #-}
7+
import Data.Monoid
8+
9+
10+
-- some comment
11+
class Semigroup a => SomeData a
12+
13+
instance SomeData All

Diff for: ghcide/test/data/import-placement/MultiLinePragma.hs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{-# OPTIONS_GHC -Wall #-}
2+
{-# LANGUAGE OverloadedStrings #-}
3+
{-# LANGUAGE RecordWildCards,
4+
OverloadedStrings #-}
5+
{-# OPTIONS_GHC -Wall,
6+
-Wno-unused-imports #-}
7+
8+
9+
-- some comment
10+
class Semigroup a => SomeData a
11+
12+
instance SomeData All
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
4+
{-# LANGUAGE TupleSections #-}
5+
import Data.Monoid
6+
7+
8+
9+
10+
class Semigroup a => SomeData a
11+
instance SomeData All
12+
13+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
14+
15+
addOne :: Int -> Int
16+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
4+
{-# LANGUAGE TupleSections #-}
5+
6+
7+
8+
9+
class Semigroup a => SomeData a
10+
instance SomeData All
11+
12+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
13+
14+
addOne :: Int -> Int
15+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Data.Monoid
2+
class Semigroup a => SomeData a
3+
instance SomeData All
4+
5+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
6+
7+
addOne :: Int -> Int
8+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Semigroup a => SomeData a
2+
instance SomeData All
3+
4+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
5+
6+
addOne :: Int -> Int
7+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
{-# OPTIONS_GHC -Wall,
4+
OPTIONS_GHC -Wno-unrecognised-pragmas #-}
5+
-- another comment
6+
-- oh
7+
{- multi line
8+
comment
9+
-}
10+
11+
{-# LANGUAGE TupleSections #-}
12+
import Data.Monoid
13+
{- some comment -}
14+
15+
-- again
16+
class Semigroup a => SomeData a
17+
instance SomeData All
18+
19+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
20+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
21+
22+
addOne :: Int -> Int
23+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
{-# OPTIONS_GHC -Wall,
4+
OPTIONS_GHC -Wno-unrecognised-pragmas #-}
5+
-- another comment
6+
-- oh
7+
{- multi line
8+
comment
9+
-}
10+
11+
{-# LANGUAGE TupleSections #-}
12+
{- some comment -}
13+
14+
-- again
15+
class Semigroup a => SomeData a
16+
instance SomeData All
17+
18+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
19+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
20+
21+
addOne :: Int -> Int
22+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
{-# OPTIONS_GHC -Wall #-}
4+
-- another comment
5+
6+
{-# LANGUAGE TupleSections #-}
7+
import Data.Monoid
8+
{- some comment -}
9+
10+
11+
class Semigroup a => SomeData a
12+
instance SomeData All
13+
14+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
15+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
16+
17+
addOne :: Int -> Int
18+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
{-# OPTIONS_GHC -Wall #-}
4+
-- another comment
5+
6+
{-# LANGUAGE TupleSections #-}
7+
{- some comment -}
8+
9+
10+
class Semigroup a => SomeData a
11+
instance SomeData All
12+
13+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
14+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
15+
16+
addOne :: Int -> Int
17+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
{-# OPTIONS_GHC -Wall #-}
3+
4+
{-# LANGUAGE TupleSections #-}
5+
module Test
6+
( SomeData(..)
7+
) where
8+
import Data.Text
9+
import Data.Monoid
10+
11+
12+
class Semigroup a => SomeData a
13+
instance SomeData All
14+
15+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
16+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
17+
18+
addOne :: Int -> Int
19+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
{-# OPTIONS_GHC -Wall #-}
3+
4+
{-# LANGUAGE TupleSections #-}
5+
module Test
6+
( SomeData(..)
7+
) where
8+
import Data.Text
9+
10+
11+
class Semigroup a => SomeData a
12+
instance SomeData All
13+
14+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
15+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
16+
17+
addOne :: Int -> Int
18+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
4+
{-# OPTIONS_GHC -Wall #-}
5+
6+
{-# LANGUAGE TupleSections #-}
7+
module Test
8+
( SomeData(..)
9+
) where
10+
import Data.Monoid
11+
12+
13+
14+
15+
class Semigroup a => SomeData a
16+
instance SomeData All
17+
18+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
19+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
20+
21+
addOne :: Int -> Int
22+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
4+
{-# OPTIONS_GHC -Wall #-}
5+
6+
{-# LANGUAGE TupleSections #-}
7+
module Test
8+
( SomeData(..)
9+
) where
10+
11+
12+
13+
14+
class Semigroup a => SomeData a
15+
instance SomeData All
16+
17+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
18+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
19+
20+
addOne :: Int -> Int
21+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
import Data.Monoid
3+
4+
class Semigroup a => SomeData a
5+
instance SomeData All
6+
7+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
8+
9+
f :: Int -> Int
10+
f x = x * x

Diff for: ghcide/test/data/import-placement/ShebangNotAtTop.hs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
class Semigroup a => SomeData a
4+
instance SomeData All
5+
6+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
7+
8+
f :: Int -> Int
9+
f x = x * x
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Data.Monoid
2+
class Semigroup a => SomeData a
3+
instance SomeData All
4+
5+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
6+
7+
f :: Int -> Int
8+
f x = x * x
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Semigroup a => SomeData a
2+
instance SomeData All
3+
4+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
5+
6+
f :: Int -> Int
7+
f x = x * x
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
4+
{-# OPTIONS_GHC -Wall #-}
5+
6+
7+
8+
{-# LANGUAGE TupleSections #-}
9+
import Data.Monoid
10+
11+
12+
13+
14+
class Semigroup a => SomeData a
15+
instance SomeData All
16+
17+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
18+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
19+
20+
addOne :: Int -> Int
21+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
3+
4+
{-# OPTIONS_GHC -Wall #-}
5+
6+
7+
8+
{-# LANGUAGE TupleSections #-}
9+
10+
11+
12+
13+
class Semigroup a => SomeData a
14+
instance SomeData All
15+
16+
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (hp: with hp; [ turtle ])"
17+
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
18+
19+
addOne :: Int -> Int
20+
addOne x = x + 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module Asdf
2+
(f
3+
, where')
4+
5+
where
6+
import Data.Int
7+
8+
9+
10+
f :: Int64 -> Int64
11+
f = id'
12+
where id' = id
13+
14+
g :: Int -> Int
15+
g = id
16+
17+
where' :: Int -> Int
18+
where' = id
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module Asdf
2+
(f
3+
, where')
4+
5+
where
6+
7+
8+
9+
f :: Int64 -> Int64
10+
f = id'
11+
where id' = id
12+
13+
g :: Int -> Int
14+
g = id
15+
16+
where' :: Int -> Int
17+
where' = id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module Asdf
2+
3+
4+
where
5+
import Data.Int
6+
7+
8+
f :: Int64 -> Int64
9+
f = id'
10+
where id' = id
11+
12+
g :: Int -> Int
13+
g = id
14+
15+
where' :: Int -> Int
16+
where' = id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module Asdf
2+
3+
4+
where
5+
6+
7+
f :: Int64 -> Int64
8+
f = id'
9+
where id' = id
10+
11+
g :: Int -> Int
12+
g = id
13+
14+
where' :: Int -> Int
15+
where' = id

0 commit comments

Comments
 (0)