Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test to print nested json #806

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gsabran
Copy link
Contributor

@gsabran gsabran commented Feb 21, 2017

Just adding a test to make sure nested JSON gets printed correctly (which they do) that was in #801

}

func testJson() {
let dictionary = ["1":2,"2":2,"three":3,"list":["aa","bb","dd"], "foo": []] as NSDictionary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this dictionary should format with a trailing space after :, just like line 135.

@@ -120,5 +120,28 @@ class PrintableTests: XCTestCase {
XCTAssertTrue(description.range(of: "\"1\":2", options: NSString.CompareOptions.caseInsensitive) != nil)
XCTAssertTrue(description.range(of: "\"2\":\"two\"", options: NSString.CompareOptions.caseInsensitive) != nil)
XCTAssertTrue(description.range(of: "\"3\":null", options: NSString.CompareOptions.caseInsensitive) != nil)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

description2 = description2.replacingOccurrences(of: "\n", with: "")
description2 = description2.replacingOccurrences(of: " ", with: "")
XCTAssertTrue(description2.range(of: "\"json\":{", options: NSString.CompareOptions.caseInsensitive) != nil)
XCTAssertTrue(description2.range(of: description, options: NSString.CompareOptions.caseInsensitive) != nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 100 characters or less: currently 109 characters (line_length)

}
description2 = description2.replacingOccurrences(of: "\n", with: "")
description2 = description2.replacingOccurrences(of: " ", with: "")
XCTAssertTrue(description2.range(of: "\"json\":{", options: NSString.CompareOptions.caseInsensitive) != nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 100 characters or less: currently 110 characters (line_length)

}

func testJson() {
let dictionary = ["1": 2,"2": 2,"three": 3,"list": ["aa", "bb", "dd"], "foo": []] as NSDictionary

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma Spacing Violation: There should be no space before and one after any comma. (comma)

}

func testJson() {
let dictionary = ["1": 2,"2": 2,"three": 3,"list": ["aa", "bb", "dd"], "foo": []] as NSDictionary

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma Spacing Violation: There should be no space before and one after any comma. (comma)

@wongzigii
Copy link
Member

Hey @gsabran Seems like the format is broken, would you mind fixing it? Or I will do it by myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants