summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/tests/all.T1
-rw-r--r--libraries/base/tests/trace.hs12
-rw-r--r--libraries/base/tests/trace.stderr8
-rw-r--r--libraries/base/tests/trace.stdout6
4 files changed, 27 insertions, 0 deletions
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T
index 901b5c91f1..d39b41b92a 100644
--- a/libraries/base/tests/all.T
+++ b/libraries/base/tests/all.T
@@ -262,3 +262,4 @@ test('T18642', extra_run_opts('+RTS -T -RTS'), compile_and_run, ['-O2'])
test('T19288', exit_code(1), compile_and_run, [''])
test('T19719', normal, compile_and_run, [''])
test('T20107', extra_run_opts('+RTS -M50M'), compile_and_run, ['-package bytestring'])
+test('trace', normal, compile_and_run, [''])
diff --git a/libraries/base/tests/trace.hs b/libraries/base/tests/trace.hs
new file mode 100644
index 0000000000..46fdad6dab
--- /dev/null
+++ b/libraries/base/tests/trace.hs
@@ -0,0 +1,12 @@
+import Debug.Trace
+
+main :: IO ()
+main = do
+ putStrLn $ trace "one" "two"
+ putStrLn $ traceShow (3 :: Int) "four"
+ putStrLn $ traceId "five"
+ print $ traceShowId (6 :: Int)
+ putStrLn $ traceWith (take 3) "seven"
+ putStrLn $ traceShowWith length "eight"
+ traceIO "nine"
+ traceM "ten"
diff --git a/libraries/base/tests/trace.stderr b/libraries/base/tests/trace.stderr
new file mode 100644
index 0000000000..5c4a13fbc7
--- /dev/null
+++ b/libraries/base/tests/trace.stderr
@@ -0,0 +1,8 @@
+one
+3
+five
+6
+sev
+5
+nine
+ten
diff --git a/libraries/base/tests/trace.stdout b/libraries/base/tests/trace.stdout
new file mode 100644
index 0000000000..3b5df74e68
--- /dev/null
+++ b/libraries/base/tests/trace.stdout
@@ -0,0 +1,6 @@
+two
+four
+five
+6
+seven
+eight