summaryrefslogtreecommitdiff
path: root/test/-ext-/test_printf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-/test_printf.rb')
-rw-r--r--test/-ext-/test_printf.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/-ext-/test_printf.rb b/test/-ext-/test_printf.rb
index 609af7ca7a7..235865dbdc1 100644
--- a/test/-ext-/test_printf.rb
+++ b/test/-ext-/test_printf.rb
@@ -181,4 +181,10 @@ class Test_SPrintf < Test::Unit::TestCase
zero: zr, width: width,
prec: prec))
}
+
+ def test_string_prec
+ assert_equal("a", Bug::Printf.("s", "a", prec: 3)[0])
+ assert_equal(" a", Bug::Printf.("s", "a", width: 3, prec: 3)[0])
+ assert_equal("a ", Bug::Printf.("s", "a", minus: true, width: 3, prec: 3)[0])
+ end
end