@@ -22,10 +22,10 @@ struct PredicateTests {
2222
2323 @Test func predicate1( ) {
2424
25- let predicate : FetchRequest . Predicate = " id " > Int64 ( 0 )
25+ let predicate : FetchRequest . Predicate = Person . CodingKeys . id > Int64 ( 0 )
2626 && " id " != Int64 ( 99 )
27- && " name " . compare ( . beginsWith, . attribute( . string( " C " ) ) )
28- && " name " . compare ( . contains, [ . diacriticInsensitive, . caseInsensitive] , . attribute( . string( " COLE " ) ) )
27+ && Person . CodingKeys . name. compare ( . beginsWith, . attribute( . string( " C " ) ) )
28+ && Person . CodingKeys . name. compare ( . contains, [ . diacriticInsensitive, . caseInsensitive] , . attribute( . string( " COLE " ) ) )
2929
3030 #expect( predicate. description == #"((id > 0 AND id != 99) AND name BEGINSWITH "C") AND name CONTAINS[cd] "COLE""# )
3131 }
@@ -71,7 +71,7 @@ struct PredicateTests {
7171
7272 let future = Date . distantFuture
7373
74- let predicate : FetchRequest . Predicate = ( " name " ) . compare ( . matches, [ . caseInsensitive] , . attribute( . string( #"event \d"# ) ) ) && [
74+ let predicate : FetchRequest . Predicate = Person . CodingKeys . name. compare ( . matches, [ . caseInsensitive] , . attribute( . string( #"event \d"# ) ) ) && [
7575 ( " start " ) < future,
7676 ( " speakers.@count " ) > 0
7777 ]
@@ -104,6 +104,11 @@ internal extension PredicateTests {
104104 self . id = id
105105 self . name = name
106106 }
107+
108+ enum CodingKeys : String , CodingKey {
109+ case id
110+ case name
111+ }
107112 }
108113
109114 struct Event : Equatable , Hashable , Codable {
@@ -119,6 +124,13 @@ internal extension PredicateTests {
119124 self . start = start
120125 self . speakers = speakers
121126 }
127+
128+ enum CodingKeys : String , CodingKey {
129+ case id
130+ case name
131+ case start
132+ case speakers
133+ }
122134 }
123135}
124136
0 commit comments