Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis committed Mar 12, 2024
1 parent 38710b3 commit 1379703
Showing 1 changed file with 6 additions and 117 deletions.
123 changes: 6 additions & 117 deletions Tests/CustomDumpTests/DumpTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -708,123 +708,12 @@ final class DumpTests: XCTestCase {
}

func testKeyPath() {
var dump = ""
#if swift(>=5.9) && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS))
if #available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) {
dump = ""
customDump(\UserClass.name, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\UserClass.name
"""#
)

dump = ""
customDump(\Pair.driver.name, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\Pair.driver.name
"""#
)

dump = ""
customDump(\User.name.count, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\User.name.count
"""#
)

dump = ""
customDump(\(x: Double, y: Double).x, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\(x: Double, y: Double).x
"""#
)

dump = ""
customDump(\Item.$isInStock, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\Item.$isInStock
"""#
)

dump = ""
customDump(\Wrapped<String>.count, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\Wrapped<String>.subscript(dynamicMember: <unknown>)
"""#
)
return
}
#endif
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
// Run twice to exercise cached lookup
for _ in 1...2 {
dump = ""
customDump(\UserClass.name, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\UserClass.name
"""#
)

dump = ""
customDump(\Pair.driver.name, to: &dump)
XCTAssertNoDifference(
dump,
#"""
\Pair.driver.name
"""#
)

dump = ""
customDump(\User.name.count, to: &dump)
XCTAssertNoDifference(
dump,
#"""
KeyPath<User, Int>
"""#
)

dump = ""
customDump(\(x: Double, y: Double).x, to: &dump)
XCTAssertNoDifference(
dump,
#"""
WritableKeyPath<(x: Double, y: Double), Double>
"""#
)

dump = ""
customDump(\Item.$isInStock, to: &dump)
XCTAssertNoDifference(
dump,
#"""
KeyPath<Item, Wrapped<Bool>>
"""#
)

dump = ""
customDump(\Wrapped<String>.count, to: &dump)
XCTAssertNoDifference(
dump,
#"""
KeyPath<Wrapped<String>, Int>
"""#
)
}
#endif
_ = String(customDumping: \UserClass.name)
_ = String(customDumping: \Pair.driver.name)
_ = String(customDumping: \User.name.count)
_ = String(customDumping: \(x: Double, y: Double).x)
_ = String(customDumping: \Item.$isInStock)
_ = String(customDumping: \Wrapped<String>.count)
}

func testNamespacedTypes() {
Expand Down

0 comments on commit 1379703

Please sign in to comment.