mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
29 lines
739 B
Swift
29 lines
739 B
Swift
// RUN: %target-run-simple-swift
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: reflection
|
|
|
|
import StdlibUnittest
|
|
|
|
|
|
let PrintTests = TestSuite("PrintDictionary")
|
|
|
|
PrintTests.test("Printable") {
|
|
expectPrinted("[:]", [String: Int]())
|
|
expectDebugPrinted("[:]", [String: Int]())
|
|
|
|
expectPrinted("[\"aaa\": 1]", ["aaa": 1])
|
|
expectDebugPrinted("[\"aaa\": 1]", ["aaa": 1])
|
|
|
|
let d0 = ["aaa": 1, "bbb": 2]
|
|
expectPrinted(expectedOneOf: ["[\"aaa\": 1, \"bbb\": 2]",
|
|
"[\"bbb\": 2, \"aaa\": 1]"], d0)
|
|
expectDebugPrinted(expectedOneOf: ["[\"aaa\": 1, \"bbb\": 2]",
|
|
"[\"bbb\": 2, \"aaa\": 1]"], d0)
|
|
|
|
let d1 = ["aaa": "bbb"]
|
|
expectPrinted("[\"aaa\": \"bbb\"]", d1)
|
|
expectDebugPrinted("[\"aaa\": \"bbb\"]", d1)
|
|
}
|
|
|
|
runAllTests()
|