summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Thorn <mcthorn@gmail.com>2020-03-03 10:03:28 -0800
committerMark Thorn <mcthorn@gmail.com>2020-03-03 10:03:28 -0800
commitac2d2c9b1bb42f3cad9f176b4072c2db58978d6d (patch)
tree2bc2f0a50b70e1c76a0aa6ba16aeb408fd67c948 /test
parentbb8a35ef7e45654ce3e57c9154da014432a46d13 (diff)
downloadpsych-ac2d2c9b1bb42f3cad9f176b4072c2db58978d6d.zip
Fix ArgumentError with leading and trailing underscores in number strings.
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_scalar_scanner.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/psych/test_scalar_scanner.rb b/test/psych/test_scalar_scanner.rb
index d12a905..1bd6488 100644
--- a/test/psych/test_scalar_scanner.rb
+++ b/test/psych/test_scalar_scanner.rb
@@ -120,6 +120,7 @@ module Psych
assert_equal 123_456_789, ss.tokenize('123_456_789')
assert_equal 123_456_789, ss.tokenize('123,456,789')
assert_equal 123_456_789, ss.tokenize('1_2,3,4_5,6_789')
+ assert_equal 123_456_789, ss.tokenize('1_2,3,4_5,6_789_')
assert_equal 0b010101010, ss.tokenize('0b010101010')
assert_equal 0b010101010, ss.tokenize('0b0,1_0,1_,0,1_01,0')
@@ -129,6 +130,8 @@ module Psych
assert_equal 0x123456789abcdef, ss.tokenize('0x123456789abcdef')
assert_equal 0x123456789abcdef, ss.tokenize('0x12_,34,_56,_789abcdef')
+ assert_equal 0x123456789abcdef, ss.tokenize('0x_12_,34,_56,_789abcdef')
+ assert_equal 0x123456789abcdef, ss.tokenize('0x12_,34,_56,_789abcdef__')
end
end
end