From c01f5f6a3701c3e1e1b9b13d583b33affebc951d Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Thu, 1 Feb 2024 08:43:55 -0800 Subject: [PATCH] Add test case --- Tests/CasePathsTests/CasePathsTests.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/CasePathsTests/CasePathsTests.swift b/Tests/CasePathsTests/CasePathsTests.swift index c2417b1c..02ea8df2 100644 --- a/Tests/CasePathsTests/CasePathsTests.swift +++ b/Tests/CasePathsTests/CasePathsTests.swift @@ -174,6 +174,13 @@ final class CasePathsTests: XCTestCase { guard let b = caseB(valueA) else { return XCTFail() } XCTAssertEqual(b, .b("Hello")) } + + func testExistentials_Optional() { + let foo: PartialCaseKeyPath = \.foo + XCTAssertNotNil(foo(String?.none as Any)) + XCTAssertNotNil(foo(String?.some("Blob") as Any)) + XCTAssertNotNil(foo("Blob")) + } #endif }