Created
May 24, 2011 13:56
-
-
Save fd/988743 to your computer and use it in GitHub Desktop.
yajl-ruby parser bug.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in /Users/Simon/Projects/json_select/t) | |
FF | |
Failures: | |
1) Parser should not swallow the first object after parsing a number(integer) | |
Failure/Error: ] | |
expected: ["foo", "bar", 42, "baz", "bax"] | |
got: ["foo", "bar", 42, "bax"] (using ==) | |
Diff: | |
@@ -1,2 +1,2 @@ | |
-["foo", "bar", 42, "baz", "bax"] | |
+["foo", "bar", 42, "bax"] | |
# ./parser_spec.rb:23 | |
2) Parser should not swallow the first object after parsing a number(float) | |
Failure/Error: ] | |
expected: ["foo", "bar", 41.9, "baz", "bax"] | |
got: ["foo", "bar", 41.9, "bax"] (using ==) | |
Diff: | |
@@ -1,2 +1,2 @@ | |
-["foo", "bar", 41.9, "baz", "bax"] | |
+["foo", "bar", 41.9, "bax"] | |
# ./parser_spec.rb:44 | |
Finished in 0.00263 seconds | |
2 examples, 2 failures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yajl' | |
describe "Parser" do | |
it "should not swallow the first object after parsing a number(integer)" do | |
json_stream = <<-JSON | |
"foo" | |
"bar" | |
42 | |
"baz" | |
"bax" | |
JSON | |
objects = [] | |
Yajl::Parser.parse(json_stream) { |o| objects << o } | |
objects.should == [ | |
"foo", | |
"bar", | |
42, | |
"baz", | |
"bax" | |
] | |
end | |
it "should not swallow the first object after parsing a number(float)" do | |
json_stream = <<-JSON | |
"foo" | |
"bar" | |
41.9 | |
"baz" | |
"bax" | |
JSON | |
objects = [] | |
Yajl::Parser.parse(json_stream) { |o| objects << o } | |
objects.should == [ | |
"foo", | |
"bar", | |
41.9, | |
"baz", | |
"bax" | |
] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment