Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing bug in ignore error

  • Loading branch information...
commit 66d1f19132e71621cccd75673d285c275d8a53bf 1 parent b7727c9
@gabriel authored
View
2  Classes/NSObject+YAJL.m
@@ -70,7 +70,7 @@ - (id)yajl_JSONWithOptions:(YAJLParserOptions)options error:(NSError **)error {
[NSException raise:YAJLParsingUnsupportedException format:@"Object of type (%@) must implement dataUsingEncoding: to be parsed", [self class]];
}
- YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:YAJLParserOptionsNone error:error];
+ YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:options error:error];
id root = [document.root retain];
[document release];
return [root autorelease];
View
8 Tests/NSObjectTest.m
@@ -50,6 +50,14 @@ - (void)testCustom {
GHAssertEqualStrings(JSONString, expected, nil);
}
+- (void)testComments {
+ NSError *error = nil;
+ id JSONValue = [[self loadData:@"comments"] yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:&error];
+ GHTestLog(@"Error=%@", error);
+ GHAssertNil(error, nil);
+ GHAssertNotNil(JSONValue, nil);
+}
+
@end
View
2  Tests/YAJLParserTest.m
@@ -59,7 +59,7 @@ - (void)testError2 {
- (void)testComments {
YAJLParser *parser = [[YAJLParser alloc] initWithParserOptions:YAJLParserOptionsAllowComments];
YAJLParserStatus status = [parser parse:[self loadData:@"comments"]];
- GHAssertTrue(status == YAJLParserStatusOK, @"Should have error status");
+ GHAssertTrue(status == YAJLParserStatusOK, @"Should have OK status");
NSError *error = [parser parserError];
if (error) {
Please sign in to comment.
Something went wrong with that request. Please try again.