Skip to content

Commit bf904ca

Browse files
committed
Add regression test for multi-repl with utf-8 directory
1 parent 2135427 commit bf904ca

7 files changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Main (main) where
2+
3+
import MyLib (mylib)
4+
5+
main :: IO ()
6+
main = print mylib
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Main (main) where
2+
3+
import MyLib (mylib)
4+
5+
main :: IO ()
6+
main = print (mylib + 1)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# cabal v2-repl
2+
Resolving dependencies...
3+
Build profile: -w ghc-<GHCVER> -O1
4+
In order, the following will be built:
5+
- foo-文档-0.1.0.0 (interactive) (lib) (first run)
6+
- foo-文档-0.1.0.0 (interactive) (exe:foo) (first run)
7+
- foo-文档-0.1.0.0 (interactive) (exe:bar) (first run)
8+
Configuring library for foo-文档-0.1.0.0...
9+
Preprocessing library for foo-文档-0.1.0.0...
10+
Configuring executable 'foo' for foo-文档-0.1.0.0...
11+
Preprocessing executable 'foo' for foo-文档-0.1.0.0...
12+
Configuring executable 'bar' for foo-文档-0.1.0.0...
13+
Preprocessing executable 'bar' for foo-文档-0.1.0.0...
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: .
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Test.Cabal.Prelude
2+
3+
-- Test for issue #12573;
4+
-- If the test-directory or cabal file contain a utf-8 symbol (文档), the multi-repl shouldn't crash.
5+
main = do
6+
cabalTest' "all" $ do
7+
skipUnlessGhcVersion ">= 9.4"
8+
res <- cabalWithStdin "v2-repl" ["--enable-multi-repl", "all"] "print 0xdeadbeef"
9+
-- The multi-repl session is functional (0xdeadbeef = 3735928559)
10+
assertOutputContains "3735928559" res
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
cabal-version: 3.0
2+
name: foo-文档
3+
version: 0.1.0.0
4+
build-type: Simple
5+
6+
library
7+
default-language: Haskell2010
8+
hs-source-dirs: src
9+
exposed-modules: MyLib
10+
build-depends: base
11+
12+
executable foo
13+
default-language: Haskell2010
14+
hs-source-dirs: app
15+
main-is: Main.hs
16+
build-depends: base, foo-文档
17+
18+
executable bar
19+
default-language: Haskell2010
20+
hs-source-dirs: bar
21+
main-is: Main.hs
22+
build-depends: base, foo-文档
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module MyLib (mylib) where
2+
3+
mylib :: Integer
4+
mylib = 0xdeadc0de

0 commit comments

Comments
 (0)