Differences From Artifact [c4b49139b1]:
- File
tests/OFJSONTests.m
— part of check-in
[72c71c4eb2]
at
2012-06-10 16:07:33
on branch trunk
— JSON: Make it possible to get the invalid line.
This introduces OFInvalidJSONException, which has a property line to get
the line in which the parsing error occurred. (user: js, size: 1874) [annotate] [blame] [check-ins using] [more...]
To Artifact [788ed24fe7]:
- File tests/OFJSONTests.m — part of check-in [1abbb97747] at 2012-12-01 18:08:26 on branch trunk — OFDictionary_hashtable: Store in OFMapTable. (user: js, size: 1874) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
45 46 47 48 49 50 51 | [OFNumber numberWithBool: NO], nil], nil]; TEST(@"-[JSONValue #1]", [[s JSONValue] isEqual: d]) TEST(@"-[JSONRepresentation]", [[d JSONRepresentation] isEqual: | | | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | [OFNumber numberWithBool: NO], nil], nil]; TEST(@"-[JSONValue #1]", [[s JSONValue] isEqual: d]) TEST(@"-[JSONRepresentation]", [[d JSONRepresentation] isEqual: @"{\"x\":[0.5,15,null,\"foo\",false],\"foo\":\"ba\\r\"}"]) EXPECT_EXCEPTION(@"-[JSONValue #2]", OFInvalidJSONException, [@"{" JSONValue]) EXPECT_EXCEPTION(@"-[JSONValue #3]", OFInvalidJSONException, [@"]" JSONValue]) EXPECT_EXCEPTION(@"-[JSONValue #4]", OFInvalidJSONException, [@"bar" JSONValue]) EXPECT_EXCEPTION(@"-[JSONValue #5]", OFInvalidJSONException, [@"[\"a\" \"b\"]" JSONValue]) [pool drain]; } @end |