mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
beffa72c27
commit
44353d0dee
2 changed files with 10 additions and 6 deletions
|
@ -15,7 +15,7 @@ module Psych
|
||||||
# Taken from http://yaml.org/type/int.html
|
# Taken from http://yaml.org/type/int.html
|
||||||
INTEGER = /^(?:[-+]?0b[0-1_,]+ (?# base 2)
|
INTEGER = /^(?:[-+]?0b[0-1_,]+ (?# base 2)
|
||||||
|[-+]?0[0-7_,]+ (?# base 8)
|
|[-+]?0[0-7_,]+ (?# base 8)
|
||||||
|[-+]?(?:\d|[1-9][0-9_,]*[^_]) (?# base 10)
|
|[-+]?(?:0|[1-9]([0-9]|,[0-9]|_[0-9])*) (?# base 10)
|
||||||
|[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x
|
|[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x
|
||||||
|
|
||||||
attr_reader :class_loader
|
attr_reader :class_loader
|
||||||
|
|
|
@ -115,11 +115,15 @@ module Psych
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_scan_strings_starting_with_underscores
|
def test_scan_strings_starting_with_underscores
|
||||||
assert_equal "_100", ss.tokenize('_100')
|
assert_equal '_100', ss.tokenize('_100')
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_scan_strings_starting_with_number
|
||||||
|
assert_equal '450D', ss.tokenize('450D')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_scan_strings_ending_with_underscores
|
def test_scan_strings_ending_with_underscores
|
||||||
assert_equal "100_", ss.tokenize('100_')
|
assert_equal '100_', ss.tokenize('100_')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_scan_int_commas_and_underscores
|
def test_scan_int_commas_and_underscores
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue