     // Note: When encoding a JSON object to a string, Mac and Linux produce different key orderings.
     // This is valid, since there is no required order for the keys in a Swift Dictionary or JSON object.
     // However, the different key orderings make it difficult to compare the strings for equality.
-    // Instead of directly comparing strings for equality, we have chosen to sort the strings and
-    // ensure that they contain the same characters.
+    // The `prettyPrinted` option also uses varying amounts of whitespace on Mac and Linux.
+    // Instead of directly comparing strings for equality, we strip all whitespace then sort the
+    // resulting strings, to ensure that they contain the same characters.
 
     static var allTests = [
         ("testEncodeNil", testEncodeNil),

              }
            }
            """
        XCTAssertEqual(json.sorted(), expected.sorted())
    }
    
    func testEncodeAdditionalProperties() {

              }
            }
            """
        XCTAssertEqual(
            json.components(separatedBy: .whitespacesAndNewlines).joined().sorted(),
            expected.components(separatedBy: .whitespacesAndNewlines).joined().sorted()
        )
    }

    func testEncodeCustom() {
