mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-15 21:53:39 +01:00
add tests for expressio evaluations
This commit is contained in:
@@ -72,8 +72,13 @@ class Person: CoreStoreObject {
|
|||||||
affectedByKeyPaths: Person.keyPathsAffectingDisplayName()
|
affectedByKeyPaths: Person.keyPathsAffectingDisplayName()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
let spouse = Relationship.ToOne<Person>("spouse")
|
||||||
|
|
||||||
let pets = Relationship.ToManyUnordered<Animal>("pets", inverse: { $0.master })
|
let pets = Relationship.ToManyUnordered<Animal>("pets", inverse: { $0.master })
|
||||||
|
|
||||||
|
private let _spouse = Relationship.ToOne<Person>("_spouseInverse", inverse: { $0.spouse })
|
||||||
|
|
||||||
|
|
||||||
private static func setTitle(_ partialObject: PartialObject<Person>, _ newValue: String) {
|
private static func setTitle(_ partialObject: PartialObject<Person>, _ newValue: String) {
|
||||||
|
|
||||||
partialObject.setPrimitiveValue(newValue, for: { $0.title })
|
partialObject.setPrimitiveValue(newValue, for: { $0.title })
|
||||||
@@ -127,7 +132,7 @@ class DynamicModelTests: BaseTestDataTestCase {
|
|||||||
versionLock: [
|
versionLock: [
|
||||||
"Animal": [0x1b59d511019695cf, 0xdeb97e86c5eff179, 0x1cfd80745646cb3, 0x4ff99416175b5b9a],
|
"Animal": [0x1b59d511019695cf, 0xdeb97e86c5eff179, 0x1cfd80745646cb3, 0x4ff99416175b5b9a],
|
||||||
"Dog": [0xe3f0afeb109b283a, 0x29998d292938eb61, 0x6aab788333cfc2a3, 0x492ff1d295910ea7],
|
"Dog": [0xe3f0afeb109b283a, 0x29998d292938eb61, 0x6aab788333cfc2a3, 0x492ff1d295910ea7],
|
||||||
"Person": [0x66d8bbfd8b21561f, 0xcecec69ecae3570f, 0xc4b73d71256214ef, 0x89b99bfe3e013e8b]
|
"Person": [0x2831cf046084d96d, 0xbe19b13ace54641, 0x635a082728b0f6f0, 0x3d4ef2dd4b74a87c]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -64,138 +64,153 @@ final class WhereTests: XCTestCase {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
XCTAssertEqual(
|
do {
|
||||||
#keyPath(TestEntity1.testToOne.testEntityID),
|
|
||||||
(\TestEntity1.testToOne ~ \.testEntityID).description,
|
XCTAssertEqual(
|
||||||
String(keyPath: \TestEntity1.testToOne ~ \.testEntityID)
|
#keyPath(TestEntity1.testToOne.testEntityID),
|
||||||
)
|
(\TestEntity1.testToOne ~ \.testEntityID).description,
|
||||||
XCTAssertEqual(
|
String(keyPath: \TestEntity1.testToOne ~ \.testEntityID)
|
||||||
#keyPath(TestEntity1.testToOne.testToOne.testToManyUnordered),
|
)
|
||||||
(\TestEntity1.testToOne ~ \.testToOne ~ \.testToManyUnordered).description,
|
XCTAssertEqual(
|
||||||
String(keyPath: \TestEntity1.testToOne ~ \.testToOne ~ \.testToManyUnordered)
|
#keyPath(TestEntity1.testToOne.testToOne.testToManyUnordered),
|
||||||
)
|
(\TestEntity1.testToOne ~ \.testToOne ~ \.testToManyUnordered).description,
|
||||||
XCTAssertEqual(
|
String(keyPath: \TestEntity1.testToOne ~ \.testToOne ~ \.testToManyUnordered)
|
||||||
#keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
)
|
||||||
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).description,
|
XCTAssertEqual(
|
||||||
String(keyPath: \TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered)
|
#keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
||||||
)
|
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).description,
|
||||||
|
String(keyPath: \TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
XCTAssertEqual(
|
||||||
|
"master.pets",
|
||||||
|
(\Animal.master ~ \.pets).description,
|
||||||
|
String(keyPath: \Animal.master ~ \.pets)
|
||||||
|
)
|
||||||
|
XCTAssertEqual(
|
||||||
|
"master.pets.species",
|
||||||
|
(\Animal.master ~ \.pets ~ \.species).description,
|
||||||
|
String(keyPath: \Animal.master ~ \.pets ~ \.species)
|
||||||
|
)
|
||||||
|
XCTAssertEqual(
|
||||||
|
"master.pets.master",
|
||||||
|
(\Animal.master ~ \.pets ~ \.master).description,
|
||||||
|
String(keyPath: \Animal.master ~ \.pets ~ \.master)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
XCTAssertEqual(
|
do {
|
||||||
"master.pets",
|
|
||||||
(\Animal.master ~ \.pets).description,
|
XCTAssertEqual(
|
||||||
String(keyPath: \Animal.master ~ \.pets)
|
#keyPath(TestEntity1.testToOne.testToManyUnordered) + ".@count",
|
||||||
)
|
(\TestEntity1.testToOne ~ \.testToManyUnordered).count().description,
|
||||||
XCTAssertEqual(
|
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).count())
|
||||||
"master.pets.species",
|
)
|
||||||
(\Animal.master ~ \.pets ~ \.species).description,
|
XCTAssertEqual(
|
||||||
String(keyPath: \Animal.master ~ \.pets ~ \.species)
|
#keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered) + ".@count",
|
||||||
)
|
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).count().description,
|
||||||
XCTAssertEqual(
|
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).count())
|
||||||
"master.pets.master",
|
)
|
||||||
(\Animal.master ~ \.pets ~ \.master).description,
|
}
|
||||||
String(keyPath: \Animal.master ~ \.pets ~ \.master)
|
do {
|
||||||
)
|
|
||||||
|
XCTAssertEqual(
|
||||||
|
"master.pets.@count",
|
||||||
|
(\Animal.master ~ \.pets).count().description,
|
||||||
|
String(keyPath: (\Animal.master ~ \.pets).count())
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
XCTAssertEqual(
|
do {
|
||||||
#keyPath(TestEntity1.testToOne.testToManyUnordered) + ".@count",
|
|
||||||
(\TestEntity1.testToOne ~ \.testToManyUnordered).count().description,
|
XCTAssertEqual(
|
||||||
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).count())
|
"ANY " + #keyPath(TestEntity1.testToOne.testToManyUnordered),
|
||||||
)
|
(\TestEntity1.testToOne ~ \.testToManyUnordered).any().description,
|
||||||
XCTAssertEqual(
|
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).any())
|
||||||
#keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered) + ".@count",
|
)
|
||||||
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).count().description,
|
XCTAssertEqual(
|
||||||
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).count())
|
"ANY " + #keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
||||||
)
|
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).any().description,
|
||||||
|
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).any())
|
||||||
|
)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
XCTAssertEqual(
|
||||||
|
"ANY master.pets",
|
||||||
|
(\Animal.master ~ \.pets).any().description,
|
||||||
|
String(keyPath: (\Animal.master ~ \.pets).any())
|
||||||
|
)
|
||||||
|
XCTAssertEqual(
|
||||||
|
"ANY master.pets.species",
|
||||||
|
(\Animal.master ~ \.pets ~ \.species).any().description,
|
||||||
|
String(keyPath: (\Animal.master ~ \.pets ~ \.species).any())
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
XCTAssertEqual(
|
do {
|
||||||
"master.pets.@count",
|
|
||||||
(\Animal.master ~ \.pets).count().description,
|
XCTAssertEqual(
|
||||||
String(keyPath: (\Animal.master ~ \.pets).count())
|
"ALL " + #keyPath(TestEntity1.testToOne.testToManyUnordered),
|
||||||
)
|
(\TestEntity1.testToOne ~ \.testToManyUnordered).all().description,
|
||||||
|
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).all())
|
||||||
|
)
|
||||||
|
XCTAssertEqual(
|
||||||
|
"ALL " + #keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
||||||
|
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).all().description,
|
||||||
|
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).all())
|
||||||
|
)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
XCTAssertEqual(
|
||||||
|
"ALL master.pets",
|
||||||
|
(\Animal.master ~ \.pets).all().description,
|
||||||
|
String(keyPath: (\Animal.master ~ \.pets).all())
|
||||||
|
)
|
||||||
|
XCTAssertEqual(
|
||||||
|
"ALL master.pets.species",
|
||||||
|
(\Animal.master ~ \.pets ~ \.species).all().description,
|
||||||
|
String(keyPath: (\Animal.master ~ \.pets ~ \.species).all())
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
XCTAssertEqual(
|
do {
|
||||||
"ANY " + #keyPath(TestEntity1.testToOne.testToManyUnordered),
|
|
||||||
(\TestEntity1.testToOne ~ \.testToManyUnordered).any().description,
|
|
||||||
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).any())
|
|
||||||
)
|
|
||||||
XCTAssertEqual(
|
|
||||||
"ANY " + #keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
|
||||||
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).any().description,
|
|
||||||
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).any())
|
|
||||||
)
|
|
||||||
}
|
|
||||||
do {
|
|
||||||
|
|
||||||
XCTAssertEqual(
|
XCTAssertEqual(
|
||||||
"ANY master.pets",
|
"NONE " + #keyPath(TestEntity1.testToOne.testToManyUnordered),
|
||||||
(\Animal.master ~ \.pets).any().description,
|
(\TestEntity1.testToOne ~ \.testToManyUnordered).none().description,
|
||||||
String(keyPath: (\Animal.master ~ \.pets).any())
|
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).none())
|
||||||
)
|
)
|
||||||
XCTAssertEqual(
|
XCTAssertEqual(
|
||||||
"ANY master.pets.species",
|
"NONE " + #keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
||||||
(\Animal.master ~ \.pets ~ \.species).any().description,
|
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).none().description,
|
||||||
String(keyPath: (\Animal.master ~ \.pets ~ \.species).any())
|
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).none())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
XCTAssertEqual(
|
XCTAssertEqual(
|
||||||
"ALL " + #keyPath(TestEntity1.testToOne.testToManyUnordered),
|
"NONE master.pets",
|
||||||
(\TestEntity1.testToOne ~ \.testToManyUnordered).all().description,
|
(\Animal.master ~ \.pets).none().description,
|
||||||
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).all())
|
String(keyPath: (\Animal.master ~ \.pets).none())
|
||||||
)
|
)
|
||||||
XCTAssertEqual(
|
XCTAssertEqual(
|
||||||
"ALL " + #keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
"NONE master.pets.species",
|
||||||
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).all().description,
|
(\Animal.master ~ \.pets ~ \.species).none().description,
|
||||||
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).all())
|
String(keyPath: (\Animal.master ~ \.pets ~ \.species).none())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
do {
|
|
||||||
|
|
||||||
XCTAssertEqual(
|
|
||||||
"ALL master.pets",
|
|
||||||
(\Animal.master ~ \.pets).all().description,
|
|
||||||
String(keyPath: (\Animal.master ~ \.pets).all())
|
|
||||||
)
|
|
||||||
XCTAssertEqual(
|
|
||||||
"ALL master.pets.species",
|
|
||||||
(\Animal.master ~ \.pets ~ \.species).all().description,
|
|
||||||
String(keyPath: (\Animal.master ~ \.pets ~ \.species).all())
|
|
||||||
)
|
|
||||||
}
|
|
||||||
do {
|
|
||||||
|
|
||||||
XCTAssertEqual(
|
|
||||||
"NONE " + #keyPath(TestEntity1.testToOne.testToManyUnordered),
|
|
||||||
(\TestEntity1.testToOne ~ \.testToManyUnordered).none().description,
|
|
||||||
String(keyPath: (\TestEntity1.testToOne ~ \.testToManyUnordered).none())
|
|
||||||
)
|
|
||||||
XCTAssertEqual(
|
|
||||||
"NONE " + #keyPath(TestEntity2.testToOne.testToOne.testToManyOrdered),
|
|
||||||
(\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).none().description,
|
|
||||||
String(keyPath: (\TestEntity2.testToOne ~ \.testToOne ~ \.testToManyOrdered).none())
|
|
||||||
)
|
|
||||||
}
|
|
||||||
do {
|
|
||||||
|
|
||||||
XCTAssertEqual(
|
|
||||||
"NONE master.pets",
|
|
||||||
(\Animal.master ~ \.pets).none().description,
|
|
||||||
String(keyPath: (\Animal.master ~ \.pets).none())
|
|
||||||
)
|
|
||||||
XCTAssertEqual(
|
|
||||||
"NONE master.pets.species",
|
|
||||||
(\Animal.master ~ \.pets ~ \.species).none().description,
|
|
||||||
String(keyPath: (\Animal.master ~ \.pets ~ \.species).none())
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,34 +220,110 @@ final class WhereTests: XCTestCase {
|
|||||||
do {
|
do {
|
||||||
|
|
||||||
let dummy = "dummy"
|
let dummy = "dummy"
|
||||||
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testString) == dummy
|
do {
|
||||||
let predicate = NSPredicate(format: "\(#keyPath(TestEntity1.testToOne.testString)) == %@", dummy)
|
|
||||||
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testString) == dummy
|
||||||
XCTAssertEqual(whereClause.predicate, predicate)
|
let predicate = NSPredicate(format: "\(#keyPath(TestEntity1.testToOne.testString)) == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<Animal> = (\.master ~ \.name) == dummy
|
||||||
|
let predicate = NSPredicate(format: "master.name == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<Animal>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
let dummy = "dummy"
|
let dummy = "dummy"
|
||||||
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToOne ~ \.testString) == dummy
|
do {
|
||||||
let predicate = NSPredicate(format: "\(#keyPath(TestEntity1.testToOne.testToOne.testString)) == %@", dummy)
|
|
||||||
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToOne ~ \.testString) == dummy
|
||||||
XCTAssertEqual(whereClause.predicate, predicate)
|
let predicate = NSPredicate(format: "\(#keyPath(TestEntity1.testToOne.testToOne.testString)) == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<Animal> = (\.master ~ \.spouse ~ \.name) == dummy
|
||||||
|
let predicate = NSPredicate(format: "master.spouse.name == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<Animal>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
let count = 3
|
let count = 3
|
||||||
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToManyUnordered).count() == count
|
do {
|
||||||
let predicate = NSPredicate(format: "\(#keyPath(TestEntity1.testToOne.testToManyUnordered)).@count == %d", count)
|
|
||||||
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToManyUnordered).count() == count
|
||||||
XCTAssertEqual(whereClause.predicate, predicate)
|
let predicate = NSPredicate(format: "\(#keyPath(TestEntity1.testToOne.testToManyUnordered)).@count == %d", count)
|
||||||
|
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<Animal> = (\.master ~ \.pets).count() == count
|
||||||
|
let predicate = NSPredicate(format: "master.pets.@count == %d", count)
|
||||||
|
XCTAssertEqual(whereClause, Where<Animal>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
||||||
let dummy = "dummy"
|
let dummy = "dummy"
|
||||||
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToManyUnordered ~ \TestEntity1.testString).any() == dummy
|
do {
|
||||||
let predicate = NSPredicate(format: "ANY \(#keyPath(TestEntity1.testToOne.testToManyUnordered)).\(#keyPath(TestEntity1.testString)) == %@", dummy)
|
|
||||||
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToManyUnordered ~ \TestEntity1.testString).any() == dummy
|
||||||
XCTAssertEqual(whereClause.predicate, predicate)
|
let predicate = NSPredicate(format: "ANY \(#keyPath(TestEntity1.testToOne.testToManyUnordered)).\(#keyPath(TestEntity1.testString)) == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<Animal> = (\.master ~ \.pets ~ \.species).any() == dummy
|
||||||
|
let predicate = NSPredicate(format: "ANY master.pets.species == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<Animal>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let dummy = "dummy"
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToManyUnordered ~ \TestEntity1.testString).all() == dummy
|
||||||
|
let predicate = NSPredicate(format: "ALL \(#keyPath(TestEntity1.testToOne.testToManyUnordered)).\(#keyPath(TestEntity1.testString)) == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<Animal> = (\.master ~ \.pets ~ \.species).all() == dummy
|
||||||
|
let predicate = NSPredicate(format: "ALL master.pets.species == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<Animal>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let dummy = "dummy"
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<TestEntity1> = (\.testToOne ~ \.testToManyUnordered ~ \TestEntity1.testString).none() == dummy
|
||||||
|
let predicate = NSPredicate(format: "NONE \(#keyPath(TestEntity1.testToOne.testToManyUnordered)).\(#keyPath(TestEntity1.testString)) == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<TestEntity1>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
|
||||||
|
let whereClause: Where<Animal> = (\.master ~ \.pets ~ \.species).none() == dummy
|
||||||
|
let predicate = NSPredicate(format: "NONE master.pets.species == %@", dummy)
|
||||||
|
XCTAssertEqual(whereClause, Where<Animal>(predicate))
|
||||||
|
XCTAssertEqual(whereClause.predicate, predicate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user