Move Text.Printf tests from testsuite; part of #1161
authorIan Lynagh <igloo@earth.li>
Fri, 3 Feb 2012 23:29:57 +0000 (23:29 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 3 Feb 2012 23:29:57 +0000 (23:29 +0000)
tests/Text.Printf/1548.hs [new file with mode: 0644]
tests/Text.Printf/1548.stdout [new file with mode: 0644]
tests/Text.Printf/Makefile [new file with mode: 0644]
tests/Text.Printf/all.T [new file with mode: 0644]

diff --git a/tests/Text.Printf/1548.hs b/tests/Text.Printf/1548.hs
new file mode 100644 (file)
index 0000000..68cec05
--- /dev/null
@@ -0,0 +1,11 @@
+import Text.Printf
+
+main = do
+   printf "%.*f\n" (2::Int) ((1/3) :: Double)
+   -- (expected: "0.33")
+
+   printf "%.3s\n" "foobar"
+   -- (expected: "foo")
+
+   printf "%10.5d\n" (4::Int)
+   -- (expected: "     00004")
diff --git a/tests/Text.Printf/1548.stdout b/tests/Text.Printf/1548.stdout
new file mode 100644 (file)
index 0000000..4976334
--- /dev/null
@@ -0,0 +1,3 @@
+0.33
+foo
+     00004
diff --git a/tests/Text.Printf/Makefile b/tests/Text.Printf/Makefile
new file mode 100644 (file)
index 0000000..4ca7751
--- /dev/null
@@ -0,0 +1,7 @@
+# This Makefile runs the tests using GHC's testsuite framework.  It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/tests/Text.Printf/all.T b/tests/Text.Printf/all.T
new file mode 100644 (file)
index 0000000..aa26ff2
--- /dev/null
@@ -0,0 +1 @@
+test('1548', normal, compile_and_run, [''])