Add a few extra cases to test_parse to show how trailing bytes are handled, especially for parsing "Infinity".

This commit is contained in:
Eric Haszlakiewicz
2017-11-26 22:34:43 -05:00
parent b8738dd623
commit 2a22858fe7
2 changed files with 31 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ new_obj.to_string("")="\u0003"
new_obj.to_string(/* hello */"foo")="foo"
new_obj.to_string(// hello
"foo")="foo"
new_obj.to_string("foo"blue)="foo"
new_obj.to_string("\u0041\u0042\u0043")="ABC"
new_obj.to_string([9,'\uDAD)=null
new_obj.to_string(null)=null
@@ -13,11 +14,22 @@ new_obj.to_string(Infinity)=Infinity
new_obj.to_string(infinity)=Infinity
new_obj.to_string(-Infinity)=-Infinity
new_obj.to_string(-infinity)=-Infinity
new_obj.to_string(Infinity!)=Infinity
new_obj.to_string(Infinitynull)=Infinity
new_obj.to_string(InfinityXXXX)=Infinity
new_obj.to_string(-Infinitynull)=-Infinity
new_obj.to_string(-InfinityXXXX)=-Infinity
new_obj.to_string(Infinoodle)=null
new_obj.to_string(InfinAAA)=null
new_obj.to_string(-Infinoodle)=null
new_obj.to_string(-InfinAAA)=null
new_obj.to_string(True)=true
new_obj.to_string(False)=false
new_obj.to_string(12)=12
new_obj.to_string(12.3)=12.3
new_obj.to_string(12.3.4)=null
new_obj.to_string(2015-01-15)=null
new_obj.to_string(12.3xxx)=12.3
new_obj.to_string({"FoO" : -12.3E512})={ "FoO": -12.3E512 }
new_obj.to_string({"FoO" : -12.3E51.2})=null
new_obj.to_string(["\n"])=[ "\n" ]