Skip to content

Commit 52e080d

Browse files
[temp] Attempt at Never tests
1 parent 0860eef commit 52e080d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Tests/WebPushTests/NeverTests.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,28 @@ import Testing
1717
@Suite("Never Tests")
1818
struct NeverTests {
1919
@Test func retroactiveCodableWorks() async throws {
20+
// struct CustomEncoder: Encoder {
21+
// var codingPath: [any CodingKey] = []
22+
// var userInfo: [CodingUserInfoKey : Any] = [:]
23+
//
24+
// func container<Key>(keyedBy type: Key.Type) -> KeyedEncodingContainer<Key> where Key : CodingKey {
25+
// fatalError()
26+
// }
27+
//
28+
// func unkeyedContainer() -> any UnkeyedEncodingContainer {
29+
// fatalError()
30+
// }
31+
//
32+
// func singleValueContainer() -> any SingleValueEncodingContainer {
33+
// fatalError()
34+
// }
35+
// }
36+
//
37+
// struct DummyNever: Encodable {}
38+
//
39+
// let encodeFunction = unsafeBitCast(Never.encode, to: type(of: DummyNever.encode))
40+
// try encodeFunction(DummyNever())(CustomEncoder())
41+
2042
#expect(throws: DecodingError.self, performing: {
2143
try JSONDecoder().decode(Never.self, from: Data("null".utf8))
2244
})

0 commit comments

Comments
 (0)