@@ -16,22 +16,22 @@ final class NSPredicateTests: XCTestCase {
1616
1717 func testDescription( ) {
1818
19- XCTAssertEqual ( ( . keyPath( " name " ) == . value ( . string( " Coleman " ) ) ) . description,
19+ XCTAssertEqual ( ( . keyPath( " name " ) == . attribute ( . string( " Coleman " ) ) ) . description,
2020 NSPredicate ( format: " name == \" Coleman \" " ) . description)
21- XCTAssertEqual ( ( ( . keyPath( " name " ) != . value ( . null) ) as FetchRequest . Predicate) . description,
21+ XCTAssertEqual ( ( ( . keyPath( " name " ) != . attribute ( . null) ) as FetchRequest . Predicate) . description,
2222 NSPredicate ( format: " name != nil " ) . description)
23- XCTAssertEqual ( ( !( . keyPath( " name " ) == . value ( . null) ) ) . description,
23+ XCTAssertEqual ( ( !( . keyPath( " name " ) == . attribute ( . null) ) ) . description,
2424 NSPredicate ( format: " NOT name == nil " ) . description)
2525 }
2626
2727 func testComparison( ) {
2828
2929 let predicate : FetchRequest . Predicate = #keyPath( PersonObject . id) > Int64 ( 0 )
30- && ( #keyPath( PersonObject . name) ) . compare ( . notEqualTo, . value ( . null) )
30+ && ( #keyPath( PersonObject . name) ) . compare ( . notEqualTo, . attribute ( . null) )
3131 && ( #keyPath( PersonObject . id) ) != Int64 ( 99 )
3232 && ( #keyPath( PersonObject . id) ) == Int64 ( 1 )
33- && ( #keyPath( PersonObject . name) ) . compare ( . beginsWith, . value ( . string( " C " ) ) )
34- && ( #keyPath( PersonObject . name) ) . compare ( . contains, [ . diacriticInsensitive, . caseInsensitive] , . value ( . string( " COLE " ) ) )
33+ && ( #keyPath( PersonObject . name) ) . compare ( . beginsWith, . attribute ( . string( " C " ) ) )
34+ && ( #keyPath( PersonObject . name) ) . compare ( . contains, [ . diacriticInsensitive, . caseInsensitive] , . attribute ( . string( " COLE " ) ) )
3535
3636 let converted = predicate. toFoundation ( )
3737
@@ -69,7 +69,7 @@ final class NSPredicateTests: XCTestCase {
6969
7070 let now = Date ( )
7171
72- let predicate : FetchRequest . Predicate = ( #keyPath( EventObject . name) ) . compare ( . matches, [ . caseInsensitive] , . value ( . string( #"\w+ event"# ) ) )
72+ let predicate : FetchRequest . Predicate = ( #keyPath( EventObject . name) ) . compare ( . matches, [ . caseInsensitive] , . attribute ( . string( #"\w+ event"# ) ) )
7373 && ( #keyPath( EventObject . start) ) < now
7474 && ( " speakers.@count " ) > 0
7575
@@ -122,7 +122,7 @@ final class NSPredicateTests: XCTestCase {
122122
123123 let now = Date ( )
124124
125- let predicate : FetchRequest . Predicate = ( #keyPath( EventObject . name) ) . compare ( . matches, [ . caseInsensitive] , . value ( . string( #"event \d"# ) ) ) && [
125+ let predicate : FetchRequest . Predicate = ( #keyPath( EventObject . name) ) . compare ( . matches, [ . caseInsensitive] , . attribute ( . string( #"event \d"# ) ) ) && [
126126 ( #keyPath( EventObject . start) ) < now,
127127 ( " speakers.@count " ) > 0
128128 ]
@@ -142,10 +142,10 @@ final class NSPredicateTests: XCTestCase {
142142 attributes. numbers = [ 0 , 1 , 2 , 3 ]
143143 attributes. strings = [ " 1 " , " 2 " , " 3 " ]
144144
145- let predicate : FetchRequest . Predicate = ( #keyPath( AttributesObject . string) ) . compare ( . equalTo, . value ( . null) )
146- && ( #keyPath( AttributesObject . data) ) . compare ( . notEqualTo, . value ( . null) )
147- && ( #keyPath( AttributesObject . numbers) ) . compare ( . contains, . value ( . int16( 1 ) ) )
148- && ( #keyPath( AttributesObject . strings) ) . compare ( . contains, . value ( . string( " 1 " ) ) )
145+ let predicate : FetchRequest . Predicate = ( #keyPath( AttributesObject . string) ) . compare ( . equalTo, . attribute ( . null) )
146+ && ( #keyPath( AttributesObject . data) ) . compare ( . notEqualTo, . attribute ( . null) )
147+ && ( #keyPath( AttributesObject . numbers) ) . compare ( . contains, . attribute ( . int16( 1 ) ) )
148+ && ( #keyPath( AttributesObject . strings) ) . compare ( . contains, . attribute ( . string( " 1 " ) ) )
149149
150150 let nsPredicate = predicate. toFoundation ( )
151151
0 commit comments