Move example to separate cabal file
authorLuke Lau <luke_lau@icloud.com>
Wed, 1 Aug 2018 13:29:30 +0000 (14:29 +0100)
committerLuke Lau <luke_lau@icloud.com>
Wed, 1 Aug 2018 13:31:31 +0000 (14:31 +0100)
Prevents example being installed with cabal install

.gitignore
README.md
example/Test.hs [moved from example/Main.hs with 82% similarity]
example/cabal.project [new file with mode: 0644]
example/example.cabal [new file with mode: 0644]
lsp-test.cabal

index e6ad272600f4e4807589e1b9da4d1c98207d17f7..21a619508fe5119a0b25209eaed928395ab3196d 100644 (file)
@@ -8,5 +8,10 @@ cabal.project.local*
 **/.DS_Store
 *.swp
 
+example/dist
+example/dist-newstyle
+example/cabal.project.local
+example/.ghc.environment.*
+
 # used for rerunning failed hspec tests
 .hspec-failures
index 6fa8ce6881809af144c4b138e1edfa81c880e8d7..3151bbf6c84df12850be5ac2eece6e954655f4c4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -34,6 +34,7 @@ count 4 (message :: Session ApplyWorkspaceEditRequest)
 anyRequest <|> anyResponse
 ```
 
+Try out the example tests in the `example` directory with `cabal new-test`.
 For more examples check the [Wiki](https://github.com/Bubba/haskell-lsp-test/wiki/Introduction)
 
 ## Developing
similarity index 82%
rename from example/Main.hs
rename to example/Test.hs
index 1e2e3baf3356b36f6eb09967a02ce2e7fbd12c0a..0f5cdb46fea65960e8978677fb0d702cb30ae5e5 100644 (file)
@@ -3,8 +3,8 @@ import Control.Monad.IO.Class
 import Language.Haskell.LSP.Test
 import Language.Haskell.LSP.Types
 
-main = runSession "hie --lsp" fullCaps "test/data/renamePass" $ do
-  docItem <- openDoc "Desktop/simple.hs" "haskell"
+main = runSession "hie --lsp" fullCaps "../test/data/" $ do
+  docItem <- openDoc "Rename.hs" "haskell"
   
   -- Use your favourite favourite combinators.
   skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
diff --git a/example/cabal.project b/example/cabal.project
new file mode 100644 (file)
index 0000000..2aea019
--- /dev/null
@@ -0,0 +1,2 @@
+packages: .
+          ../
diff --git a/example/example.cabal b/example/example.cabal
new file mode 100644 (file)
index 0000000..d6c88c4
--- /dev/null
@@ -0,0 +1,11 @@
+name:          example
+version:       0.0.0.0
+cabal-version: >= 1.22
+build-type:    Simple
+
+test-suite tests
+  type:          exitcode-stdio-1.0
+  main-is:       Test.hs
+  build-depends: base
+               , lsp-test
+               , parser-combinators
index c293534f1f2be532976d2b963b213540d3809369..4a23da94e6311e8d85ca619829695d6d0c7917ae 100644 (file)
@@ -91,9 +91,3 @@ test-suite tests
                      , text
   default-language:    Haskell2010
 
-executable lsp-test-example
-  hs-source-dirs:      example
-  main-is:             Main.hs
-  default-language:    Haskell2010
-  build-depends:       base >= 4.7 && < 5
-                     , lsp-test