Skip to content

Commit 464af8e

Browse files
committed
Merge pull request purescript#1323 from hdgarrood/should-fail-with
Check the right kind of error is thrown in tests
2 parents eadd1da + d8e46b0 commit 464af8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+169
-44
lines changed

examples/failing/365.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- @shouldFailWith CycleInDeclaration
12
module Main where
23

34
import Prelude

examples/failing/438.purs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
-- @shouldFailWith NoInstanceFound
2+
3+
-- See issue 438 for details: this test is mainly here to test that code like
4+
-- this doesn't cause the compiler to loop.
5+
16
module Main where
27

38
import Prelude
49

510
data Fix f = In (f (Fix f))
611

712
instance eqFix :: (Eq (f (Fix f))) => Eq (Fix f) where
8-
(==) (In f) (In g) = f == g
9-
(/=) a b = not (a == b)
13+
eq (In f) (In g) = f == g
1014

1115
example = In [] == In []

examples/failing/ArrayType.purs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- @shouldFailWith TypesDoNotUnify
2+
13
module Main where
24

35
import Prelude

examples/failing/Arrays.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
-- @shouldFailWith ExprDoesNotHaveType
12
module Main where
23

34
import Prelude
45

6+
foreign import (!!) :: forall a. Array a -> Int -> a
7+
58
test = \arr -> arr !! (0 !! 0)

examples/failing/CaseDoesNotMatchAllConstructorArgs.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- @shouldFailWith IncorrectConstructorArity
12
module Main where
23

34
import Prelude

examples/failing/Do.purs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- @shouldFailWith InvalidDoBind
2+
-- @shouldFailWith InvalidDoLet
13
module Main where
24

35
import Prelude

examples/failing/DoNotSuggestComposition.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
-- @shouldFailWith TypesDoNotUnify
2+
-- TODO: Check that this does not produce a "function composition is (<<<)"
3+
-- suggestion.
14
module DoNotSuggestComposition where
25

36
import Prelude
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
-- @shouldFailWith CannotApplyFunction
2+
-- TODO: Check that this does not produce a "function composition is (<<<)"
3+
-- suggestion.
4+
15
module DoNotSuggestComposition2 where
26

37
foo = let x = { y: 3 } in x 2

examples/failing/DuplicateDeclarationsInLet.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- @shouldFailWith OverlappingNamesInLet
12
module Main where
23

34
import Prelude

examples/failing/DuplicateProperties1.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- @shouldFailWith TypesDoNotUnify
12
module DuplicateProperties where
23

34
import Prelude

0 commit comments

Comments
 (0)