From 3d5c4f8121c4e78d9e76f3b0ade2e9742aeae673 Mon Sep 17 00:00:00 2001 From: John Rommel Estropia Date: Fri, 17 Jun 2016 02:44:37 +0900 Subject: [PATCH] removed unit test check for undefined behavior --- CoreStoreTests/ImportTests.swift | 1 - Sources/Importing/BaseDataTransaction+Importing.swift | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CoreStoreTests/ImportTests.swift b/CoreStoreTests/ImportTests.swift index 0667059..789a622 100644 --- a/CoreStoreTests/ImportTests.swift +++ b/CoreStoreTests/ImportTests.swift @@ -740,7 +740,6 @@ class ImportTests: BaseTestDataTestCase { catch _ as TestInsertError { errorExpectation.fulfill() - XCTAssertEqual(transaction.fetchCount(From(TestEntity1)), 7) let object = transaction.fetchOne(From(TestEntity1), Where("testEntityID", isEqualTo: 106)) XCTAssertNotNil(object) diff --git a/Sources/Importing/BaseDataTransaction+Importing.swift b/Sources/Importing/BaseDataTransaction+Importing.swift index 19df388..61ac229 100644 --- a/Sources/Importing/BaseDataTransaction+Importing.swift +++ b/Sources/Importing/BaseDataTransaction+Importing.swift @@ -36,6 +36,7 @@ public extension BaseDataTransaction { - parameter into: an `Into` clause specifying the entity type - parameter source: the object to import values from + - throws: an `ErrorType` thrown from any of the `ImportableObject` methods - returns: the created `ImportableObject` instance, or `nil` if the import was ignored */ public func importObject( @@ -65,6 +66,7 @@ public extension BaseDataTransaction { - parameter object: the `NSManagedObject` to update - parameter source: the object to import values from + - throws: an `ErrorType` thrown from any of the `ImportableObject` methods */ public func importObject( object: T, @@ -91,6 +93,7 @@ public extension BaseDataTransaction { - parameter into: an `Into` clause specifying the entity type - parameter sourceArray: the array of objects to import values from + - throws: an `ErrorType` thrown from any of the `ImportableObject` methods - returns: the array of created `ImportableObject` instances */ public func importObjects( @@ -126,6 +129,7 @@ public extension BaseDataTransaction { - parameter into: an `Into` clause specifying the entity type - parameter source: the object to import values from + - throws: an `ErrorType` thrown from any of the `ImportableUniqueObject` methods - returns: the created/updated `ImportableUniqueObject` instance, or `nil` if the import was ignored */ public func importUniqueObject( @@ -172,10 +176,12 @@ public extension BaseDataTransaction { /** Updates existing `ImportableUniqueObject`s or creates them by importing from the specified array of import sources. + - Warning: While the array returned from `importUniqueObjects(...)` correctly maps to the order of `sourceArray`, the order of objects called with `ImportableUniqueObject` methods is arbitrary. Do not make assumptions that any particular object will be imported ahead or after another object. - parameter into: an `Into` clause specifying the entity type - parameter sourceArray: the array of objects to import values from - parameter preProcess: a closure that lets the caller tweak the internal `UniqueIDType`-to-`ImportSource` mapping to be used for importing. Callers can remove from/add to/update `mapping` and return the updated array from the closure. + - throws: an `ErrorType` thrown from any of the `ImportableUniqueObject` methods - returns: the array of created/updated `ImportableUniqueObject` instances */ public func importUniqueObjects(