summaryrefslogtreecommitdiff
path: root/test/scanf
diff options
context:
space:
mode:
authordblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-03 12:54:13 +0000
committerdblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-03 12:54:13 +0000
commit9cab7d15ca791d0b14db03217485a7c756097a71 (patch)
tree36e2d3c91003a075b2b65a6240d6efa09f482394 /test/scanf
parent6378201f8b202e493613d1c0936788ddbe708c76 (diff)
* lib/scanf.rb: fixed bug involving matching literal '['
* test/scanf/test_scanf.rb: added test for scanf.rb fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/scanf')
-rw-r--r--test/scanf/test_scanf.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/scanf/test_scanf.rb b/test/scanf/test_scanf.rb
index fe4ac50..66ca629 100644
--- a/test/scanf/test_scanf.rb
+++ b/test/scanf/test_scanf.rb
@@ -276,6 +276,13 @@ def tests
[ "%f", "+3.25", [3.25] ],
[ "%f", "+3.25e2", [325.0] ],
[ "%f", "3.z", [3.0] ],
+
+# Testing embedded matches including literal '[' behavior
+ [",%d,%f", ",10,1.1", [10,1.1] ],
+ [" ,%d,%f", " ,10,1.1", [10,1.1] ],
+ ["[%d,%f", "[10,1.1", [10,1.1] ],
+ [" [%d,%f", " [10,1.1", [10,1.1] ],
+
]
end
end