Skip to content

Commit 4d33ba6

Browse files
wismillmergify[bot]
authored andcommitted
Add test
1 parent 87efb24 commit 4d33ba6

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

cabal-testsuite/PackageTests/JS/JsSources/jssources.cabal

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ build-type: Simple
66
library
77
default-language: Haskell2010
88
js-sources: jsbits/lib.js
9-
hs-source-dirs: src
9+
if arch(JavaScript)
10+
hs-source-dirs: srcJS
11+
else
12+
hs-source-dirs: src
1013
exposed-modules: Lib
1114
build-depends: base
1215

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# cabal v2-run
2+
Resolving dependencies...
3+
Build profile: -w ghc-<GHCVER> -O1
4+
In order, the following will be built:
5+
- jssources-0 (lib) (first run)
6+
- jssources-0 (exe:demo) (first run)
7+
Configuring library for jssources-0..
8+
Preprocessing library for jssources-0..
9+
Building library for jssources-0..
10+
Configuring executable 'demo' for jssources-0..
11+
Preprocessing executable 'demo' for jssources-0..
12+
Building executable 'demo' for jssources-0..
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Test.Cabal.Prelude
2+
3+
main = cabalTest $ do
4+
skipIfJavaScript
5+
-- Ensure the field `js-sources` does not raise issues
6+
res <- cabal' "v2-run" ["demo"]
7+
assertOutputContains "Hello Not JS!" res
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module Lib where
22

3-
foreign import javascript foo :: IO ()
3+
foo :: IO ()
4+
foo = putStrLn "Hello Not JS!"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Lib where
2+
3+
foreign import javascript foo :: IO ()

0 commit comments

Comments
 (0)