meh / jazz

Yet another library to handle JSON in Elixir.
61 stars 21 forks source link

Error when trying to parse a test file... #1

Closed n1rvana closed 10 years ago

n1rvana commented 10 years ago

Decided to do a shootout between jazz and elixir-json, but am getting errors with the test file, under 10.1 and 10.2-dev

you can see the errors and the code & files here: https://github.com/n1rvana/Shootout

Be advised, the problem may be an error on my part- I'm passing a binary in to be decoded, and then encoding the result.

meh commented 10 years ago

Checking it out, at least jazz isn't the only one failing :P

meh commented 10 years ago

Yeah, the issue is in usage, you're passing the result of JSON.encode which returns an { :ok, result } tuple, either use JSON.encode! and JSON.decode! or use case to get the actual result from the tuple.

meh commented 10 years ago
iex(1)> Shootout.timed_run
Preparing to test encoding and decoding.
Test file loaded, test begins...
Test finished, Decode: -34881 Encode: -20326