summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorgaryb <>2018-11-22 00:41:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-11-22 00:41:00 (GMT)
commite475885477784963005d0b81bdc96f96002e07b4 (patch)
tree79f3c797bd8fede81aa85feee1b448dd09aec48a /tests
parent25a279f1e1a547125036fd4b81f0549bf37f5339 (diff)
version 0.12.10.12.1
Diffstat (limited to 'tests')
-rw-r--r--tests/Language/PureScript/Ide/CompletionSpec.hs7
-rw-r--r--tests/Language/PureScript/Ide/RebuildSpec.hs26
-rw-r--r--tests/Language/PureScript/Ide/StateSpec.hs4
-rw-r--r--tests/TestCompiler.hs15
-rw-r--r--tests/TestCoreFn.hs16
-rw-r--r--tests/TestPrimDocs.hs1
-rw-r--r--tests/TestPsci/CommandTest.hs21
-rw-r--r--tests/TestPsci/CompletionTest.hs8
-rw-r--r--tests/TestPsci/TestEnv.hs53
-rw-r--r--tests/TestUtils.hs10
-rw-r--r--tests/purs/failing/3405.purs8
-rw-r--r--tests/purs/failing/MissingClassMember.purs3
-rw-r--r--tests/purs/passing/3388.purs10
-rw-r--r--tests/purs/passing/3410.purs11
-rw-r--r--tests/purs/warning/CustomWarning4.purs31
-rw-r--r--tests/support/bower.json107
-rw-r--r--tests/support/package-lock.json171
-rw-r--r--tests/support/psci/Reload.edit4
-rw-r--r--tests/support/psci/Reload.purs4
-rw-r--r--tests/support/psci/Sample.purs0
20 files changed, 227 insertions, 283 deletions
diff --git a/tests/Language/PureScript/Ide/CompletionSpec.hs b/tests/Language/PureScript/Ide/CompletionSpec.hs
index 4df331a..c9a84cf 100644
--- a/tests/Language/PureScript/Ide/CompletionSpec.hs
+++ b/tests/Language/PureScript/Ide/CompletionSpec.hs
@@ -4,7 +4,8 @@ module Language.PureScript.Ide.CompletionSpec where
import Protolude
-import Language.PureScript as P
+import qualified Data.Set as Set
+import qualified Language.PureScript as P
import Language.PureScript.Ide.Test as Test
import Language.PureScript.Ide.Command as Command
import Language.PureScript.Ide.Completion
@@ -30,7 +31,7 @@ load :: [Text] -> Command
load = LoadSync . map Test.mn
rebuildSync :: FilePath -> Command
-rebuildSync fp = RebuildSync ("src" </> fp) Nothing
+rebuildSync fp = RebuildSync ("src" </> fp) Nothing (Set.singleton P.JS)
spec :: Spec
spec = describe "Applying completion options" $ do
@@ -63,4 +64,4 @@ spec = describe "Applying completion options" $ do
Test.runIde [ load ["CompletionSpecDocs"]
, typ "withType"
]
- result `shouldSatisfy` \res -> complDocumentation res == Just "Doc *123*\n" \ No newline at end of file
+ result `shouldSatisfy` \res -> complDocumentation res == Just "Doc *123*\n"
diff --git a/tests/Language/PureScript/Ide/RebuildSpec.hs b/tests/Language/PureScript/Ide/RebuildSpec.hs
index 03ea688..0aea8e2 100644
--- a/tests/Language/PureScript/Ide/RebuildSpec.hs
+++ b/tests/Language/PureScript/Ide/RebuildSpec.hs
@@ -4,6 +4,8 @@ module Language.PureScript.Ide.RebuildSpec where
import Protolude
+import qualified Data.Set as Set
+import qualified Language.PureScript as P
import Language.PureScript.AST.SourcePos (spanName)
import Language.PureScript.Ide.Command
import Language.PureScript.Ide.Completion
@@ -11,16 +13,20 @@ import Language.PureScript.Ide.Matcher
import Language.PureScript.Ide.Types
import qualified Language.PureScript.Ide.Test as Test
import System.FilePath
+import System.Directory (doesFileExist, removePathForcibly)
import Test.Hspec
+defaultTarget :: Set P.CodegenTarget
+defaultTarget = Set.singleton P.JS
+
load :: [Text] -> Command
load = LoadSync . map Test.mn
rebuild :: FilePath -> Command
-rebuild fp = Rebuild ("src" </> fp) Nothing
+rebuild fp = Rebuild ("src" </> fp) Nothing defaultTarget
rebuildSync :: FilePath -> Command
-rebuildSync fp = RebuildSync ("src" </> fp) Nothing
+rebuildSync fp = RebuildSync ("src" </> fp) Nothing defaultTarget
spec :: Spec
spec = describe "Rebuilding single modules" $ do
@@ -67,6 +73,20 @@ spec = describe "Rebuilding single modules" $ do
Test.runIde'
editorConfig
emptyIdeState
- [ RebuildSync ("src" </> "RebuildSpecWithHiddenIdent.purs") (Just "actualFile")
+ [ RebuildSync ("src" </> "RebuildSpecWithHiddenIdent.purs") (Just "actualFile") defaultTarget
, Complete [] (flexMatcher "hid") (Just (Test.mn "RebuildSpecWithHiddenIdent")) defaultCompletionOptions]
map spanName (complLocation result) `shouldBe` Just "actualFile"
+ it "doesn't produce JS when an empty target list is supplied" $ do
+ exists <- Test.inProject $ do
+ let indexJs = "output" </> "RebuildSpecSingleModule" </> "index.js"
+ removePathForcibly ("output" </> "RebuildSpecSingleModule")
+ _ <- Test.runIde [ RebuildSync ("src" </> "RebuildSpecSingleModule.purs") Nothing Set.empty ]
+ doesFileExist indexJs
+ exists `shouldBe` False
+ it "does produce corefn if it's a codegen target" $ do
+ exists <- Test.inProject $ do
+ let corefn = "output" </> "RebuildSpecSingleModule" </> "corefn.json"
+ removePathForcibly ("output" </> "RebuildSpecSingleModule")
+ _ <- Test.runIde [ RebuildSync ("src" </> "RebuildSpecSingleModule.purs") Nothing (Set.singleton P.CoreFn) ]
+ doesFileExist corefn
+ exists `shouldBe` True
diff --git a/tests/Language/PureScript/Ide/StateSpec.hs b/tests/Language/PureScript/Ide/StateSpec.hs
index 67a6671..33d9f30 100644
--- a/tests/Language/PureScript/Ide/StateSpec.hs
+++ b/tests/Language/PureScript/Ide/StateSpec.hs
@@ -3,11 +3,11 @@
module Language.PureScript.Ide.StateSpec where
import Protolude
-import Control.Lens hiding ((&))
import Language.PureScript.Ide.Types
import Language.PureScript.Ide.State
import Language.PureScript.Ide.Test
import qualified Language.PureScript as P
+import Lens.Micro.Platform hiding ((&))
import Test.Hspec
import qualified Data.Map as Map
@@ -91,7 +91,7 @@ spec = do
it "resolves an instance for an existing type class" $ do
resolveInstances (Map.singleton (mn "InstanceModule") ef) moduleMap
`shouldSatisfy`
- elemOf (ix (mn "ClassModule") . ix 0 . idaDeclaration . _IdeDeclTypeClass . ideTCInstances . folded) ideInstance
+ anyOf (ix (mn "ClassModule") . ix 0 . idaDeclaration . _IdeDeclTypeClass . ideTCInstances . folded) (ideInstance ==)
describe "resolving data constructors" $ do
it "resolves a constructor" $ do
resolveDataConstructorsForModule (snd testModule)
diff --git a/tests/TestCompiler.hs b/tests/TestCompiler.hs
index 9c3bed7..ddd7eda 100644
--- a/tests/TestCompiler.hs
+++ b/tests/TestCompiler.hs
@@ -40,7 +40,6 @@ import Control.Monad
import Control.Arrow ((***), (>>>))
import Control.Monad.Reader
-import Control.Monad.Writer.Strict
import Control.Monad.Trans.Except
import System.Exit
@@ -234,13 +233,25 @@ checkShouldFailWith expected errs =
checkPositioned :: P.MultipleErrors -> Maybe String
checkPositioned errs =
- case mapMaybe (\err -> maybe (Just err) (const Nothing) (P.errorSpan err)) (P.runMultipleErrors errs) of
+ case mapMaybe guardSpans (P.runMultipleErrors errs) of
[] ->
Nothing
errs' ->
Just
$ "Found errors with missing source spans:\n"
++ unlines (map (P.renderBox . P.prettyPrintSingleError P.defaultPPEOptions) errs')
+ where
+ guardSpans :: P.ErrorMessage -> Maybe P.ErrorMessage
+ guardSpans err = case P.errorSpan err of
+ Just ss | any (not . isNonsenseSpan) ss -> Nothing
+ _ -> Just err
+
+ isNonsenseSpan :: P.SourceSpan -> Bool
+ isNonsenseSpan (P.SourceSpan spanName spanStart spanEnd) =
+ spanName == "" || spanName == "<module>" || (spanStart == emptyPos && spanEnd == emptyPos)
+
+ emptyPos :: P.SourcePos
+ emptyPos = P.SourcePos 0 0
assertCompiles
:: [P.Module]
diff --git a/tests/TestCoreFn.hs b/tests/TestCoreFn.hs
index 7c27220..2fcb158 100644
--- a/tests/TestCoreFn.hs
+++ b/tests/TestCoreFn.hs
@@ -9,7 +9,7 @@ import Prelude ()
import Prelude.Compat
import Data.Aeson
-import Data.Aeson.Types
+import Data.Aeson.Types as Aeson
import Data.Version
import Language.PureScript.AST.Literals
@@ -37,7 +37,7 @@ parseMod m =
in snd <$> parseModule (moduleToJSON v m)
isSuccess :: Result a -> Bool
-isSuccess (Success _) = True
+isSuccess (Aeson.Success _) = True
isSuccess _ = False
spec :: Spec
@@ -52,42 +52,42 @@ spec = context "CoreFnFromJsonTest" $ do
r `shouldSatisfy` isSuccess
case r of
Error _ -> return ()
- Success m -> moduleName m `shouldBe` mn
+ Aeson.Success m -> moduleName m `shouldBe` mn
specify "should parse source span" $ do
let r = parseMod $ Module ss [] mn mp [] [] [] []
r `shouldSatisfy` isSuccess
case r of
Error _ -> return ()
- Success m -> moduleSourceSpan m `shouldBe` ss
+ Aeson.Success m -> moduleSourceSpan m `shouldBe` ss
specify "should parse module path" $ do
let r = parseMod $ Module ss [] mn mp [] [] [] []
r `shouldSatisfy` isSuccess
case r of
Error _ -> return ()
- Success m -> modulePath m `shouldBe` mp
+ Aeson.Success m -> modulePath m `shouldBe` mp
specify "should parse imports" $ do
let r = parseMod $ Module ss [] mn mp [(ann, mn)] [] [] []
r `shouldSatisfy` isSuccess
case r of
Error _ -> return ()
- Success m -> moduleImports m `shouldBe` [(ann, mn)]
+ Aeson.Success m -> moduleImports m `shouldBe` [(ann, mn)]
specify "should parse exports" $ do
let r = parseMod $ Module ss [] mn mp [] [Ident "exp"] [] []
r `shouldSatisfy` isSuccess
case r of
Error _ -> return ()
- Success m -> moduleExports m `shouldBe` [Ident "exp"]
+ Aeson.Success m -> moduleExports m `shouldBe` [Ident "exp"]
specify "should parse foreign" $ do
let r = parseMod $ Module ss [] mn mp [] [] [Ident "exp"] []
r `shouldSatisfy` isSuccess
case r of
Error _ -> return ()
- Success m -> moduleForeign m `shouldBe` [Ident "exp"]
+ Aeson.Success m -> moduleForeign m `shouldBe` [Ident "exp"]
context "Expr" $ do
specify "should parse literals" $ do
diff --git a/tests/TestPrimDocs.hs b/tests/TestPrimDocs.hs
index 1eb68d5..584c8a9 100644
--- a/tests/TestPrimDocs.hs
+++ b/tests/TestPrimDocs.hs
@@ -3,7 +3,6 @@ module TestPrimDocs where
import Prelude
import Control.Monad
-import Data.Monoid ((<>))
import Data.List ((\\))
import qualified Data.Map as Map
import qualified Data.Set as Set
diff --git a/tests/TestPsci/CommandTest.hs b/tests/TestPsci/CommandTest.hs
index a84fdca..7de6412 100644
--- a/tests/TestPsci/CommandTest.hs
+++ b/tests/TestPsci/CommandTest.hs
@@ -1,10 +1,16 @@
+{-# LANGUAGE OverloadedStrings #-}
+
module TestPsci.CommandTest where
import Prelude ()
import Prelude.Compat
+import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.RWS.Strict (get)
+import Language.PureScript (moduleNameFromString)
import Language.PureScript.Interactive
+import System.FilePath ((</>))
+import System.Directory (getCurrentDirectory)
import Test.Hspec
import TestPsci.TestEnv
@@ -42,5 +48,20 @@ commandTests = context "commandTests" $ do
":complete M.a" `prints` unlines ["M.ap", "M.apply"]
specPSCi ":browse" $ do
+ ":browse Data.Void" `printed` flip shouldContain "data Void"
+ ":browse Data.Void" `printed` flip shouldContain "absurd ::"
+
+ specPSCi ":reload, :browse" $ do
+ cwd <- liftIO getCurrentDirectory
+ let new = cwd </> "tests" </> "support" </> "psci" </> "Reload.edit"
+
+ ":browse Reload" `printed` flip shouldContain "reload ::"
+ ":browse Reload" `printed` flip shouldNotContain "edited ::"
+
+ simulateModuleEdit (moduleNameFromString "Reload") new $ do
+ run ":reload"
+ ":browse Reload" `printed` flip shouldNotContain "reload ::"
+ ":browse Reload" `printed` flip shouldContain "edited ::"
+
":browse Mirp" `printed` flip shouldContain "is not valid"
":browse Prim" `printed` flip shouldContain "class Partial"
diff --git a/tests/TestPsci/CompletionTest.hs b/tests/TestPsci/CompletionTest.hs
index c513cb4..13ba6c0 100644
--- a/tests/TestPsci/CompletionTest.hs
+++ b/tests/TestPsci/CompletionTest.hs
@@ -34,12 +34,12 @@ completionTestData supportModuleNames =
, (":b", [":browse"])
-- :browse should complete module names
- , (":b Eff", map (":b Effect" ++) ["", ".Unsafe", ".Class", ".Console", ".Uncurried", ".Ref"])
- , (":b Effect.", map (":b Effect" ++) [".Unsafe", ".Class", ".Console", ".Uncurried", ".Ref"])
+ , (":b Eff", map (":b Effect" ++) ["", ".Unsafe", ".Class", ".Class.Console", ".Console", ".Uncurried", ".Ref"])
+ , (":b Effect.", map (":b Effect" ++) [".Unsafe", ".Class", ".Class.Console", ".Console", ".Uncurried", ".Ref"])
-- import should complete module names
- , ("import Eff", map ("import Effect" ++) ["", ".Unsafe", ".Class", ".Console", ".Uncurried", ".Ref"])
- , ("import Effect.", map ("import Effect" ++) [".Unsafe", ".Class", ".Console", ".Uncurried", ".Ref"])
+ , ("import Eff", map ("import Effect" ++) ["", ".Unsafe", ".Class", ".Class.Console", ".Console", ".Uncurried", ".Ref"])
+ , ("import Effect.", map ("import Effect" ++) [".Unsafe", ".Class", ".Class.Console", ".Console", ".Uncurried", ".Ref"])
-- :quit, :help, :reload, :clear should not complete
, (":help ", [])
diff --git a/tests/TestPsci/TestEnv.hs b/tests/TestPsci/TestEnv.hs
index a41c018..84cb90f 100644
--- a/tests/TestPsci/TestEnv.hs
+++ b/tests/TestPsci/TestEnv.hs
@@ -1,16 +1,21 @@
+{-# LANGUAGE OverloadedStrings #-}
+
module TestPsci.TestEnv where
import Prelude ()
import Prelude.Compat
-import Control.Monad (void)
+import Control.Exception.Lifted (bracket_)
+import Control.Monad (void, when)
import Control.Monad.IO.Class (liftIO)
-import Control.Monad.Trans.RWS.Strict (evalRWST, RWST)
+import Control.Monad.Trans.RWS.Strict (evalRWST, asks, local, RWST)
+import Data.List (isSuffixOf)
+import qualified Data.Text as T
import qualified Language.PureScript as P
import Language.PureScript.Interactive
-import System.Directory (getCurrentDirectory)
+import System.Directory (getCurrentDirectory, doesPathExist, removeFile)
import System.Exit
-import System.FilePath ((</>))
+import System.FilePath ((</>), pathSeparator)
import qualified System.FilePath.Glob as Glob
import System.Process (readProcessWithExitCode)
import Test.Hspec (shouldBe, Expectation)
@@ -23,9 +28,10 @@ initTestPSCiEnv :: IO (PSCiState, PSCiConfig)
initTestPSCiEnv = do
-- Load test support packages
cwd <- getCurrentDirectory
- let supportDir = cwd </> "tests" </> "support" </> "bower_components"
- let supportFiles ext = Glob.globDir1 (Glob.compile ("purescript-*/src/**/*." ++ ext)) supportDir
- pursFiles <- supportFiles "purs"
+ let supportDir = cwd </> "tests" </> "support"
+ psciFiles <- Glob.globDir1 (Glob.compile "**/*.purs") (supportDir </> "psci")
+ libraries <- Glob.globDir1 (Glob.compile "purescript-*/src/**/*.purs") (supportDir </> "bower_components")
+ let pursFiles = psciFiles ++ libraries
modulesOrError <- loadAllModules pursFiles
case modulesOrError of
Left err ->
@@ -35,8 +41,8 @@ initTestPSCiEnv = do
makeResultOrError <- runMake . make $ modules
case makeResultOrError of
Left errs -> putStrLn (P.prettyPrintMultipleErrors P.defaultPPEOptions errs) >> exitFailure
- Right (externs, env) ->
- return (updateLoadedExterns (const (zip (map snd modules) externs)) initialPSCiState, PSCiConfig pursFiles env)
+ Right (externs, _) ->
+ return (updateLoadedExterns (const (zip (map snd modules) externs)) initialPSCiState, PSCiConfig pursFiles)
-- | Execute a TestPSCi, returning IO
execTestPSCi :: TestPSCi a -> IO a
@@ -71,9 +77,8 @@ runAndEval comm jsOutputEval textOutputEval =
-- | Run a PSCi command, evaluate compiled JS, and ignore evaluation output and printed output
run :: String -> TestPSCi ()
-run comm = runAndEval comm evalJsAndIgnore ignorePrinted
+run comm = runAndEval comm (void jsEval) ignorePrinted
where
- evalJsAndIgnore = jsEval *> return ()
ignorePrinted _ = return ()
-- | A lifted evaluation of Hspec 'shouldBe' for the TestPSCi
@@ -95,3 +100,29 @@ prints command expected = printed command (`shouldBe` expected)
printed :: String -> (String -> Expectation) -> TestPSCi ()
printed command f = runAndEval command (void jsEval) (liftIO . f)
+
+simulateModuleEdit :: P.ModuleName -> FilePath -> TestPSCi a -> TestPSCi a
+simulateModuleEdit mn newPath action = do
+ ms <- asks psciFileGlobs
+ case replacePath ms of
+ Nothing -> fail $ "Did not find " ++ inputPath ++ " in psciFileGlobs"
+ Just xs' -> local (\c -> c { psciFileGlobs = xs' }) temporarily <* rebuild
+
+ where
+ outputPath = modulesDir </> T.unpack (P.runModuleName mn) </> "index.js"
+ inputPath = T.unpack (T.replace "." slash (P.runModuleName mn)) ++ ".purs"
+ slash = T.singleton pathSeparator
+
+ replacePath :: [String] -> Maybe [String]
+ replacePath (x:xs)
+ | inputPath `isSuffixOf` x = Just (newPath : xs)
+ | otherwise = fmap (x:) (replacePath xs)
+ replacePath [] = Nothing
+
+ -- Simply adding the file to `PSCiConfig.fileGlobs` isn't sufficient; running
+ -- ":reload" might not rebuild because the compiled JS artifact has a more
+ -- recent timestamp than the "new" source file `newPath`.
+ temporarily = bracket_ enableRebuild enableRebuild action
+ enableRebuild = liftIO $ do { b <- doesPathExist outputPath; when b (removeFile outputPath) }
+ rebuild = handleCommand discard (return ()) discard ReloadState
+ discard _ = return ()
diff --git a/tests/TestUtils.hs b/tests/TestUtils.hs
index 9c3a692..6c70807 100644
--- a/tests/TestUtils.hs
+++ b/tests/TestUtils.hs
@@ -66,10 +66,12 @@ readInput inputFiles = forM inputFiles $ \inputFile -> do
getSupportModuleTuples :: IO [(FilePath, P.Module)]
getSupportModuleTuples = do
cd <- getCurrentDirectory
- let supportDir = cd </> "tests" </> "support" </> "bower_components"
- supportPurs <- Glob.globDir1 (Glob.compile "purescript-*/src/**/*.purs") supportDir
- supportPursFiles <- readInput supportPurs
- modules <- runExceptT $ ExceptT . return $ P.parseModulesFromFiles id supportPursFiles
+ let supportDir = cd </> "tests" </> "support"
+ psciFiles <- Glob.globDir1 (Glob.compile "**/*.purs") (supportDir </> "psci")
+ libraries <- Glob.globDir1 (Glob.compile "purescript-*/src/**/*.purs") (supportDir </> "bower_components")
+ let pursFiles = psciFiles ++ libraries
+ fileContents <- readInput pursFiles
+ modules <- runExceptT $ ExceptT . return $ P.parseModulesFromFiles id fileContents
case modules of
Right ms -> return ms
Left errs -> fail (P.prettyPrintMultipleErrors P.defaultPPEOptions errs)
diff --git a/tests/purs/failing/3405.purs b/tests/purs/failing/3405.purs
new file mode 100644
index 0000000..de7ab7c
--- /dev/null
+++ b/tests/purs/failing/3405.purs
@@ -0,0 +1,8 @@
+-- @shouldFailWith CannotFindDerivingType
+module Main where
+
+import Prelude
+
+type Something = Int
+
+derive instance eqSomething ∷ Eq Something
diff --git a/tests/purs/failing/MissingClassMember.purs b/tests/purs/failing/MissingClassMember.purs
index 488fccf..42a06a9 100644
--- a/tests/purs/failing/MissingClassMember.purs
+++ b/tests/purs/failing/MissingClassMember.purs
@@ -1,11 +1,10 @@
-- @shouldFailWith MissingClassMember
module Main where
-import Prelude
-
class A a where
a :: a -> String
b :: a -> Number
+ c :: forall f. a -> f a
instance aString :: A String where
a s = s
diff --git a/tests/purs/passing/3388.purs b/tests/purs/passing/3388.purs
new file mode 100644
index 0000000..71feafb
--- /dev/null
+++ b/tests/purs/passing/3388.purs
@@ -0,0 +1,10 @@
+module Main where
+
+import Prelude
+import Effect.Console (log)
+
+main = do
+ let
+ x = { a: 42, b: "foo" }
+ { a, b } = x { a = 43 }
+ log "Done"
diff --git a/tests/purs/passing/3410.purs b/tests/purs/passing/3410.purs
new file mode 100644
index 0000000..42e1cfb
--- /dev/null
+++ b/tests/purs/passing/3410.purs
@@ -0,0 +1,11 @@
+module Main
+ ( module Prelude
+ , module DEN
+ , main
+ ) where
+
+import Prelude
+import Data.Either.Nested (type (\/)) as DEN
+import Effect.Console (log)
+
+main = log "Done"
diff --git a/tests/purs/warning/CustomWarning4.purs b/tests/purs/warning/CustomWarning4.purs
new file mode 100644
index 0000000..5ab9de6
--- /dev/null
+++ b/tests/purs/warning/CustomWarning4.purs
@@ -0,0 +1,31 @@
+-- @shouldWarnWith UserDefinedWarning
+-- @shouldWarnWith UserDefinedWarning
+-- @shouldWarnWith UserDefinedWarning
+-- @shouldWarnWith UserDefinedWarning
+module Main where
+
+import Prim.TypeError (class Warn, Beside, QuoteLabel, Text)
+import Prim
+import Type.Row (class RowToList, Cons, Nil)
+
+data Label (l :: Symbol) = Label
+
+baz ::
+ forall row label typ.
+ RowToList row (Cons label typ Nil) =>
+ Warn (Beside (Text "Custom label ") (QuoteLabel label)) =>
+ Record row ->
+ String
+baz _ = ""
+
+baz' :: String
+baz' = baz { hello: 1 }
+
+baz'' :: String
+baz'' = baz { "hello": 1 }
+
+baz''' :: String
+baz''' = baz { "h e l l o": 1 }
+
+baz'''' :: String
+baz'''' = baz { "hel\"lo": 1 }
diff --git a/tests/support/bower.json b/tests/support/bower.json
index b44fb23..4d66df9 100644
--- a/tests/support/bower.json
+++ b/tests/support/bower.json
@@ -1,77 +1,40 @@
{
"name": "purescript-test-suite-support",
"dependencies": {
- "purescript-arrays": "purescript/purescript-arrays#compiler/0.12",
- "purescript-assert": "purescript/purescript-assert#compiler/0.12",
- "purescript-bifunctors": "purescript/purescript-bifunctors#compiler/0.12",
- "purescript-console": "purescript/purescript-console#compiler/0.12",
- "purescript-control": "purescript/purescript-control#compiler/0.12",
- "purescript-distributive": "purescript/purescript-distributive#compiler/0.12",
- "purescript-effect": "purescript/purescript-effect#compiler/0.12",
- "purescript-either": "purescript/purescript-either#compiler/0.12",
- "purescript-foldable-traversable": "purescript/purescript-foldable-traversable#compiler/0.12",
- "purescript-functions": "purescript/purescript-functions#compiler/0.12",
- "purescript-gen": "purescript/purescript-gen#compiler/0.12",
- "purescript-generics-rep": "purescript/purescript-generics-rep#compiler/0.12",
- "purescript-globals": "purescript/purescript-globals#compiler/0.12",
- "purescript-identity": "purescript/purescript-identity#compiler/0.12",
- "purescript-integers": "purescript/purescript-integers#compiler/0.12",
- "purescript-invariant": "purescript/purescript-invariant#compiler/0.12",
- "purescript-lazy": "purescript/purescript-lazy#compiler/0.12",
- "purescript-lists": "purescript/purescript-lists#compiler/0.12",
- "purescript-math": "purescript/purescript-math#compiler/0.12",
- "purescript-maybe": "purescript/purescript-maybe#compiler/0.12",
- "purescript-newtype": "purescript/purescript-newtype#compiler/0.12",
- "purescript-nonempty": "purescript/purescript-nonempty#compiler/0.12",
- "purescript-partial": "purescript/purescript-partial#compiler/0.12",
- "purescript-prelude": "purescript/purescript-prelude#compiler/0.12",
- "purescript-proxy": "purescript/purescript-proxy#compiler/0.12",
- "purescript-psci-support": "purescript/purescript-psci-support#compiler/0.12",
- "purescript-refs": "purescript/purescript-refs#compiler/0.12",
- "purescript-st": "purescript/purescript-st#compiler/0.12",
- "purescript-strings": "purescript/purescript-strings#compiler/0.12",
- "purescript-tailrec": "purescript/purescript-tailrec#compiler/0.12",
- "purescript-tuples": "purescript/purescript-tuples#compiler/0.12",
- "purescript-type-equality": "purescript/purescript-type-equality#compiler/0.12",
- "purescript-typelevel-prelude": "purescript/purescript-typelevel-prelude#compiler/0.12",
- "purescript-unfoldable": "purescript/purescript-unfoldable#compiler/0.12",
- "purescript-unsafe-coerce": "purescript/purescript-unsafe-coerce#compiler/0.12"
- },
- "resolutions": {
- "purescript-arrays": "compiler/0.12",
- "purescript-assert": "compiler/0.12",
- "purescript-bifunctors": "compiler/0.12",
- "purescript-console": "compiler/0.12",
- "purescript-control": "compiler/0.12",
- "purescript-distributive": "compiler/0.12",
- "purescript-effect": "compiler/0.12",
- "purescript-either": "compiler/0.12",
- "purescript-foldable-traversable": "compiler/0.12",
- "purescript-functions": "compiler/0.12",
- "purescript-gen": "compiler/0.12",
- "purescript-generics-rep": "compiler/0.12",
- "purescript-globals": "compiler/0.12",
- "purescript-identity": "compiler/0.12",
- "purescript-integers": "compiler/0.12",
- "purescript-invariant": "compiler/0.12",
- "purescript-lazy": "compiler/0.12",
- "purescript-lists": "compiler/0.12",
- "purescript-math": "compiler/0.12",
- "purescript-maybe": "compiler/0.12",
- "purescript-newtype": "compiler/0.12",
- "purescript-nonempty": "compiler/0.12",
- "purescript-partial": "compiler/0.12",
- "purescript-prelude": "compiler/0.12",
- "purescript-proxy": "compiler/0.12",
- "purescript-psci-support": "compiler/0.12",
- "purescript-refs": "compiler/0.12",
- "purescript-st": "compiler/0.12",
- "purescript-strings": "compiler/0.12",
- "purescript-tailrec": "compiler/0.12",
- "purescript-tuples": "compiler/0.12",
- "purescript-type-equality": "compiler/0.12",
- "purescript-typelevel-prelude": "compiler/0.12",
- "purescript-unfoldable": "compiler/0.12",
- "purescript-unsafe-coerce": "compiler/0.12"
+ "purescript-arrays": "5.0.0",
+ "purescript-assert": "4.0.0",
+ "purescript-bifunctors": "4.0.0",
+ "purescript-console": "4.1.0",
+ "purescript-control": "4.0.0",
+ "purescript-distributive": "4.0.0",
+ "purescript-effect": "2.0.0",
+ "purescript-either": "4.0.0",
+ "purescript-foldable-traversable": "4.0.0",
+ "purescript-functions": "4.0.0",
+ "purescript-gen": "2.0.0",
+ "purescript-generics-rep": "6.0.0",
+ "purescript-globals": "4.0.0",
+ "purescript-identity": "4.0.0",
+ "purescript-integers": "4.0.0",
+ "purescript-invariant": "4.0.0",
+ "purescript-lazy": "4.0.0",
+ "purescript-lists": "5.0.0",
+ "purescript-math": "2.1.1",
+ "purescript-maybe": "4.0.0",
+ "purescript-newtype": "3.0.0",
+ "purescript-nonempty": "5.0.0",
+ "purescript-partial": "2.0.0",
+ "purescript-prelude": "4.0.0",
+ "purescript-proxy": "3.0.0",
+ "purescript-psci-support": "4.0.0",
+ "purescript-refs": "4.1.0",
+ "purescript-st": "4.0.0",
+ "purescript-strings": "4.0.0",
+ "purescript-tailrec": "4.0.0",
+ "purescript-tuples": "5.0.0",
+ "purescript-type-equality": "3.0.0",
+ "purescript-typelevel-prelude": "3.0.0",
+ "purescript-unfoldable": "4.0.0",
+ "purescript-unsafe-coerce": "4.0.0"
}
}
diff --git a/tests/support/package-lock.json b/tests/support/package-lock.json
deleted file mode 100644
index 4e3a140..0000000
--- a/tests/support/package-lock.json
+++ /dev/null
@@ -1,171 +0,0 @@
-{
- "requires": true,
- "lockfileVersion": 1,
- "dependencies": {
- "bower": {
- "version": "1.8.2",
- "resolved": "https://registry.npmjs.org/bower/-/bower-1.8.2.tgz",
- "integrity": "sha1-rfU1KcjUrwLvJPuNU0HBQZ0z4vc="
- },
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
- },
- "glob": {
- "version": "5.0.15",
- "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
- "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
- "requires": {
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
- },
- "dependencies": {
- "balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
- },
- "brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "requires": {
- "balanced-match": "1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "requires": {
- "once": "1.4.0",
- "wrappy": "1.0.2"
- }
- },
- "inherits": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
- "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
- },
- "minimatch": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
- "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
- "requires": {
- "brace-expansion": "1.1.11"
- }
- },
- "once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "requires": {
- "wrappy": "1.0.2"
- }
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
- }
- }
- },
- "rimraf": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
- "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
- "requires": {
- "glob": "7.1.2"
- },
- "dependencies": {
- "balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
- },
- "brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "requires": {
- "balanced-match": "1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
- },
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
- "requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
- }
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "requires": {
- "once": "1.4.0",
- "wrappy": "1.0.2"
- }
- },
- "inherits": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
- "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
- },
- "minimatch": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
- "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
- "requires": {
- "brace-expansion": "1.1.11"
- }
- },
- "once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "requires": {
- "wrappy": "1.0.2"
- }
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
- }
- }
- }
- }
-}
diff --git a/tests/support/psci/Reload.edit b/tests/support/psci/Reload.edit
new file mode 100644
index 0000000..21e8978
--- /dev/null
+++ b/tests/support/psci/Reload.edit
@@ -0,0 +1,4 @@
+module Reload where
+
+edited :: String
+edited = "reload"
diff --git a/tests/support/psci/Reload.purs b/tests/support/psci/Reload.purs
new file mode 100644
index 0000000..dae46c4
--- /dev/null
+++ b/tests/support/psci/Reload.purs
@@ -0,0 +1,4 @@
+module Reload where
+
+reload :: Int
+reload = 0
diff --git a/tests/support/psci/Sample.purs b/tests/support/psci/Sample.purs
deleted file mode 100644
index e69de29..0000000
--- a/tests/support/psci/Sample.purs
+++ /dev/null