summaryrefslogtreecommitdiff
path: root/libraries/base/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/tests')
-rw-r--r--libraries/base/tests/System/T23399.hs9
-rw-r--r--libraries/base/tests/System/T23399.stdout1
-rw-r--r--libraries/base/tests/System/all.T1
3 files changed, 11 insertions, 0 deletions
diff --git a/libraries/base/tests/System/T23399.hs b/libraries/base/tests/System/T23399.hs
new file mode 100644
index 0000000000..4232c94d16
--- /dev/null
+++ b/libraries/base/tests/System/T23399.hs
@@ -0,0 +1,9 @@
+module Main where
+
+import System.Posix.Internals
+
+main = do
+ r <- c_getpid
+ -- #23399: JS backend wasn't returning a valid JS number as a CPid hence
+ -- "read" would fail because the string was "0\0" (not a number, NUL byte)
+ print ((read (show r) :: Int) /= -1)
diff --git a/libraries/base/tests/System/T23399.stdout b/libraries/base/tests/System/T23399.stdout
new file mode 100644
index 0000000000..0ca95142bb
--- /dev/null
+++ b/libraries/base/tests/System/T23399.stdout
@@ -0,0 +1 @@
+True
diff --git a/libraries/base/tests/System/all.T b/libraries/base/tests/System/all.T
index 10ddd7754f..b56d239b26 100644
--- a/libraries/base/tests/System/all.T
+++ b/libraries/base/tests/System/all.T
@@ -8,3 +8,4 @@ test('system001', [js_broken(22349), when(opsys("mingw32"), skip), req_process],
compile_and_run, [''])
test('Timeout001', js_broken(22261), compile_and_run, [''])
test('T16466', normal, compile_and_run, [''])
+test('T23399', normal, compile_and_run, [''])