on master help sign in
Reorganize test directory
commite5e55b12cb76eba7e71df1b3bcbd026aaf2262ad authorEvan Czaplicki <info@elm-lang.org> dateFri 28 Nov 2014, 21:54 (12 years ago) parent9c4eb50
27 files changed+27−14
elm-compiler.cabal+5−5 tests/compiler/CompilerTest.hs → tests/Test.hs+3−2 tests/compiler/Tests/Compiler.hs → tests/Test/Compiler.hs+1−1 tests/compiler/Tests/Property.hs → tests/Test/Property.hs+17−5 tests/compiler/Tests/Property/Arbitrary.hs → tests/Test/Property/Arbitrary.hs+1−1 tests/compiler/test-files/Imports.elm → tests/test-files/Imports.elm tests/compiler/test-files/bad/BBTArgs → tests/test-files/bad/BBTArgs tests/compiler/test-files/bad/Imports/UseHiddenValues.elm → tests/test-files/bad/Imports/UseHiddenValues.elm tests/compiler/test-files/bad/InfiniteType.elm → tests/test-files/bad/InfiniteType.elm tests/compiler/test-files/bad/NonElementMain.elm → tests/test-files/bad/NonElementMain.elm tests/compiler/test-files/bad/Strings/ExtraClose.elm → tests/test-files/bad/Strings/ExtraClose.elm tests/compiler/test-files/good/AliasSubstitution.elm → tests/test-files/good/AliasSubstitution.elm tests/compiler/test-files/good/NoExpressions.elm → tests/test-files/good/NoExpressions.elm tests/compiler/test-files/good/Otherwise.elm → tests/test-files/good/Otherwise.elm tests/compiler/test-files/good/Ports.elm → tests/test-files/good/Ports.elm tests/compiler/test-files/good/PortsWithTypeAliases.elm → tests/test-files/good/PortsWithTypeAliases.elm tests/compiler/test-files/good/QuotesAndComments.elm → tests/test-files/good/QuotesAndComments.elm tests/compiler/test-files/good/Soundness/Apply.elm → tests/test-files/good/Soundness/Apply.elm tests/compiler/test-files/good/Soundness/ApplyAnnotated.elm → tests/test-files/good/Soundness/ApplyAnnotated.elm tests/compiler/test-files/good/Soundness/Id.elm → tests/test-files/good/Soundness/Id.elm tests/compiler/test-files/good/Soundness/IdAnnotated.elm → tests/test-files/good/Soundness/IdAnnotated.elm tests/compiler/test-files/good/Soundness/TrickyId.elm → tests/test-files/good/Soundness/TrickyId.elm tests/compiler/test-files/good/Soundness/TrickyIdAnnotated.elm → tests/test-files/good/Soundness/TrickyIdAnnotated.elm tests/compiler/test-files/good/Strings/Multiline.elm → tests/test-files/good/Strings/Multiline.elm tests/compiler/test-files/good/Strings/MultilineNormal.elm → tests/test-files/good/Strings/MultilineNormal.elm tests/compiler/test-files/good/Unify/LockedVars.elm → tests/test-files/good/Unify/LockedVars.elm tests/compiler/test-files/good/Unify/NonHomogeneousRecords.elm → tests/test-files/good/Unify/NonHomogeneousRecords.elm
elm-compiler.cabal+5−5
@@ -191,15 +191,15 @@ Test-Suite compiler-tests
191191 exitcode-stdio-1.0
192192
193193 Hs-Source-Dirs:
194− tests/compiler, src
194+ tests, src
195195
196196 Main-is:
197− CompilerTest.hs
197+ Test.hs
198198
199199 other-modules:
200− Tests.Compiler
201− Tests.Property
202− Tests.Property.Arbitrary
200+ Test.Compiler
201+ Test.Property
202+ Test.Property.Arbitrary
203203 AST.Helpers
204204 AST.Literal
205205 AST.PrettyPrint
tests/compiler/CompilerTest.hs → tests/Test.hsrenamed+3−2
@@ -2,8 +2,9 @@ module Main where
22
33import Test.Framework
44
5−import Tests.Compiler
6−import Tests.Property
5+import Test.Compiler
6+import Test.Property
7+
78
89main :: IO ()
910main =
tests/compiler/Tests/Compiler.hs → tests/Test/Compiler.hsrenamed+1−1
@@ -1,5 +1,5 @@
11{-# OPTIONS_GHC -W #-}
2−module Tests.Compiler (compilerTests) where
2+module Test.Compiler (compilerTests) where
33
44import qualified Data.Map as Map
55import Data.Traversable (traverse)
tests/compiler/Tests/Property.hs → tests/Test/Property.hsrenamed+17−5
@@ -1,4 +1,4 @@
1−module Tests.Property where
1+module Test.Property where
22
33import Control.Applicative ((<*))
44import Test.Framework
@@ -17,7 +17,8 @@ import Parse.Helpers (IParser, iParse)
1717import Parse.Literal (literal)
1818import qualified Parse.Pattern as Pat (expr)
1919import qualified Parse.Type as Type (expr)
20−import Tests.Property.Arbitrary
20+import Test.Property.Arbitrary
21+
2122
2223propertyTests :: Test
2324propertyTests =
@@ -48,9 +49,20 @@ propertyTests =
4849 , P.Var "su'BrrbPUK6I33Eq"
4950 ]
5051
52+
5153prop_parse_print :: (Pretty a, Arbitrary a, Eq a) => IParser a -> a -> Bool
52−prop_parse_print p x =
53− either (const False) (== x) . parse_print p $ x
54+prop_parse_print parser value =
55+ either (const False) (== value) (parse_print parser value)
56+
5457
5558parse_print :: (Pretty a) => IParser a -> a -> Either String a
56−parse_print p = either (Left . show) Right . iParse (p <* eof) . P.renderStyle P.style {mode=P.LeftMode} . pretty
59+parse_print parser value =
60+ let doc =
61+ pretty value
62+
63+ string =
64+ P.renderStyle P.style { mode = P.LeftMode } doc
65+ in
66+ case iParse (parser <* eof) string of
67+ Left msg -> Left (show msg)
68+ Right x -> Right x
tests/compiler/Tests/Property/Arbitrary.hs → tests/Test/Property/Arbitrary.hsrenamed+1−1
@@ -1,5 +1,5 @@
11{-# OPTIONS_GHC -W -fno-warn-orphans #-}
2−module Tests.Property.Arbitrary where
2+module Test.Property.Arbitrary where
33
44import Control.Applicative ((<$>), (<*>), pure)
55import Test.QuickCheck.Arbitrary
tests/compiler/test-files/Imports.elm → tests/test-files/Imports.elmrenamed

The content is the same.

tests/compiler/test-files/bad/BBTArgs → tests/test-files/bad/BBTArgsrenamed

The content is the same.

tests/compiler/test-files/bad/Imports/UseHiddenValues.elm → tests/test-files/bad/Imports/UseHiddenValues.elmrenamed

The content is the same.

tests/compiler/test-files/bad/InfiniteType.elm → tests/test-files/bad/InfiniteType.elmrenamed

The content is the same.

tests/compiler/test-files/bad/NonElementMain.elm → tests/test-files/bad/NonElementMain.elmrenamed

The content is the same.

tests/compiler/test-files/bad/Strings/ExtraClose.elm → tests/test-files/bad/Strings/ExtraClose.elmrenamed

The content is the same.

tests/compiler/test-files/good/AliasSubstitution.elm → tests/test-files/good/AliasSubstitution.elmrenamed

The content is the same.

tests/compiler/test-files/good/NoExpressions.elm → tests/test-files/good/NoExpressions.elmrenamed

The content is the same.

tests/compiler/test-files/good/Otherwise.elm → tests/test-files/good/Otherwise.elmrenamed

The content is the same.

tests/compiler/test-files/good/Ports.elm → tests/test-files/good/Ports.elmrenamed

The content is the same.

tests/compiler/test-files/good/PortsWithTypeAliases.elm → tests/test-files/good/PortsWithTypeAliases.elmrenamed

The content is the same.

tests/compiler/test-files/good/QuotesAndComments.elm → tests/test-files/good/QuotesAndComments.elmrenamed

The content is the same.

tests/compiler/test-files/good/Soundness/Apply.elm → tests/test-files/good/Soundness/Apply.elmrenamed

The content is the same.

tests/compiler/test-files/good/Soundness/ApplyAnnotated.elm → tests/test-files/good/Soundness/ApplyAnnotated.elmrenamed

The content is the same.

tests/compiler/test-files/good/Soundness/Id.elm → tests/test-files/good/Soundness/Id.elmrenamed

The content is the same.

tests/compiler/test-files/good/Soundness/IdAnnotated.elm → tests/test-files/good/Soundness/IdAnnotated.elmrenamed

The content is the same.

tests/compiler/test-files/good/Soundness/TrickyId.elm → tests/test-files/good/Soundness/TrickyId.elmrenamed

The content is the same.

tests/compiler/test-files/good/Soundness/TrickyIdAnnotated.elm → tests/test-files/good/Soundness/TrickyIdAnnotated.elmrenamed

The content is the same.

tests/compiler/test-files/good/Strings/Multiline.elm → tests/test-files/good/Strings/Multiline.elmrenamed

The content is the same.

tests/compiler/test-files/good/Strings/MultilineNormal.elm → tests/test-files/good/Strings/MultilineNormal.elmrenamed

The content is the same.

tests/compiler/test-files/good/Unify/LockedVars.elm → tests/test-files/good/Unify/LockedVars.elmrenamed

The content is the same.

tests/compiler/test-files/good/Unify/NonHomogeneousRecords.elm → tests/test-files/good/Unify/NonHomogeneousRecords.elmrenamed

The content is the same.