-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: always sort JSON encoded keys (#318)
* fix: always sort JSON encoded keys * Enable more tests on Linux and Windows * more query tests * more tests * disable tests for linux and windows * Update CHANGELOG.md
- Loading branch information
Showing
21 changed files
with
124 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,14 +62,12 @@ class TestParseEncoder: XCTestCase { | |
_testRoundTrip(of: address) | ||
} | ||
|
||
#if !os(Linux) && !os(Android) && !os(Windows) | ||
func testEncodingTopLevelStructuredClass() { | ||
// Person is a class with multiple fields. | ||
let expectedJSON = "{\"name\":\"Johnny Appleseed\",\"email\":\"[email protected]\"}".data(using: .utf8)! | ||
let expectedJSON = "{\"email\":\"[email protected]\",\"name\":\"Johnny Appleseed\"}".data(using: .utf8)! | ||
let person = Person.testValue | ||
_testRoundTrip(of: person, expectedJSON: expectedJSON) | ||
} | ||
#endif | ||
|
||
func testEncodingTopLevelStructuredSingleStruct() { | ||
// Numbers is a struct which encodes as an array through a single value container. | ||
|
@@ -102,7 +100,7 @@ class TestParseEncoder: XCTestCase { | |
_testRoundTrip(of: EnhancedBool.fileNotFound, expectedJSON: "null".data(using: .utf8)!) | ||
} | ||
|
||
#if !os(Linux) && !os(Android) && !os(Windows) | ||
#if !os(Linux) && !os(Android) && !os(Windows) | ||
func testEncodingMultipleNestedContainersWithTheSameTopLevelKey() { | ||
struct Model: Codable, Equatable { | ||
let first: String | ||
|
@@ -159,7 +157,6 @@ class TestParseEncoder: XCTestCase { | |
} | ||
} | ||
#endif | ||
|
||
/* | ||
func testEncodingConflictedTypeNestedContainersWithTheSameTopLevelKey() throws { | ||
struct Model: Encodable, Equatable { | ||
|
@@ -202,13 +199,11 @@ class TestParseEncoder: XCTestCase { | |
}*/ | ||
|
||
// MARK: - Output Formatting Tests | ||
#if !os(Linux) && !os(Android) && !os(Windows) | ||
func testEncodingOutputFormattingDefault() { | ||
let expectedJSON = "{\"name\":\"Johnny Appleseed\",\"email\":\"[email protected]\"}".data(using: .utf8)! | ||
let expectedJSON = "{\"email\":\"[email protected]\",\"name\":\"Johnny Appleseed\"}".data(using: .utf8)! | ||
let person = Person.testValue | ||
_testRoundTrip(of: person, expectedJSON: expectedJSON) | ||
} | ||
#endif | ||
/* | ||
func testEncodingOutputFormattingPrettyPrinted() { | ||
let expectedJSON = "{\n \"name\" : \"Johnny Appleseed\",\n \"email\" : \"[email protected]\"\n}".data(using: .utf8)! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.