aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2013-03-03 00:45:34 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2013-03-03 00:45:34 +0530
commitbe7d02ebdde5c30d664496c57c3265469907004e (patch)
treeed7a44309221143900dcc9b2447dc645b48a373c /tests
parentb989978dd3db7e27ce62d9b43aef8564c69f3e60 (diff)
Added test cases for printf builtin
Diffstat (limited to 'tests')
-rw-r--r--tests/printf.err0
-rw-r--r--tests/printf.in19
-rw-r--r--tests/printf.out13
-rw-r--r--tests/printf.status1
4 files changed, 33 insertions, 0 deletions
diff --git a/tests/printf.err b/tests/printf.err
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/printf.err
diff --git a/tests/printf.in b/tests/printf.in
new file mode 100644
index 00000000..f0669469
--- /dev/null
+++ b/tests/printf.in
@@ -0,0 +1,19 @@
+printf "Hello %d %i %f %F %g %G\n" 1 2 3 4 5 6
+
+printf "%x %X %o %u\n" 10 11 8 -1
+printf "%a %A\n" 14 15
+
+printf "%c %s\n" a hello
+printf "%e %E\n" 5 6
+
+printf "%20d\n" 50
+printf "%-20d%d\n" 5 10
+
+printf "%*d\n" 10 100
+
+printf "%%\"\\\n"
+printf "%s\b%s\n" x y
+printf "abc\rdef\n"
+printf "Msg1\fMsg2\n"
+printf "foo\vbar\vbaz\n"
+printf "\111 \x50" # \u0051 \U00000052
diff --git a/tests/printf.out b/tests/printf.out
new file mode 100644
index 00000000..b24cfc7b
--- /dev/null
+++ b/tests/printf.out
@@ -0,0 +1,13 @@
+Hello 1 2 3.000000 4.000000 5 6
+a B 10 18446744073709551615
+0xep+0 0XFP+0
+a hello
+5.000000e+00 6.000000E+00
+ 50
+5 10
+ 100
+%"\nxy
+abc def
+Msg1 Msg2
+foo bar baz
+I P \ No newline at end of file
diff --git a/tests/printf.status b/tests/printf.status
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/tests/printf.status
@@ -0,0 +1 @@
+0