breese / trial.protocol

Network wire protocols
11 stars 4 forks source link

Add missing end_array failing test #48

Closed vinipsmaker closed 3 years ago

vinipsmaker commented 3 years ago

I was caught by surprise here. I thought I could mirror the loop at

https://github.com/breese/trial.protocol/blob/cbb39086fde32804e71e7d075267f4cbef946907/example/json/push_parser/push_parser.hpp#L29-L76

and only check for json::token::symbol::error afterwards to know if the JSON was valid. By now I see I also need to test for reader.level() == 0.

Maybe this behaviour deserves some discussion? Not really sure what's the proper take here as I just stumbled upon it.

breese commented 3 years ago

I have fixed this and the equivalent problem for end-of-object in 909633cda153346e9c637292bfe7da28267e324c