From b850ea663f24ca07500e83856c0d21e9c6605d1d Mon Sep 17 00:00:00 2001 From: Vlad Velicu Date: Fri, 4 Oct 2024 15:33:32 +0100 Subject: [PATCH] typo fix --- Objective-C/Internal/CBLQueryIndex+Internal.h | 1 + Objective-C/Tests/CollectionTest.m | 8 ------ Swift/Tests/ArrayTest.swift | 6 ++-- Swift/Tests/CBLTestCase.swift | 2 +- Swift/Tests/DictionaryTest.swift | 4 +-- Swift/Tests/DocumentTest.swift | 14 +++++----- Swift/Tests/ReplicatorTest+Collection.swift | 8 +++--- Swift/Tests/VectorSearchTest+Lazy.swift | 28 +++++++++---------- Swift/Tests/VectorSearchTest.swift | 12 ++++---- 9 files changed, 38 insertions(+), 45 deletions(-) diff --git a/Objective-C/Internal/CBLQueryIndex+Internal.h b/Objective-C/Internal/CBLQueryIndex+Internal.h index 416df3f76..bd062f706 100644 --- a/Objective-C/Internal/CBLQueryIndex+Internal.h +++ b/Objective-C/Internal/CBLQueryIndex+Internal.h @@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype) initWithC4Index: (C4Index*) c4index name: (NSString*) name collection: (CBLCollection*) collection; + @end NS_ASSUME_NONNULL_END diff --git a/Objective-C/Tests/CollectionTest.m b/Objective-C/Tests/CollectionTest.m index 7ec875d14..bf971cc20 100644 --- a/Objective-C/Tests/CollectionTest.m +++ b/Objective-C/Tests/CollectionTest.m @@ -25,14 +25,6 @@ @interface CollectionTest : CBLTestCase @implementation CollectionTest -- (void) setUp { - [super setUp]; -} - -- (void) tearDown { - [super tearDown]; -} - - (void) testGetNonExistingDoc { NSError* error = nil; CBLCollection* col = [self.db defaultCollection: &error]; diff --git a/Swift/Tests/ArrayTest.swift b/Swift/Tests/ArrayTest.swift index d408e01ba..f29427c61 100644 --- a/Swift/Tests/ArrayTest.swift +++ b/Swift/Tests/ArrayTest.swift @@ -235,7 +235,7 @@ class ArrayTest: CBLTestCase { func testUnsavedMutableArrayToJSON() throws { let json = "[{\"unsaved\":\"mutableDoc\"}]" var mArray = try MutableArrayObject(json: json) - expectExcepion(exception: .internalInconsistencyException) { + expectException(exception: .internalInconsistencyException) { let _ = mArray.toJSON() } @@ -244,7 +244,7 @@ class ArrayTest: CBLTestCase { try saveDocument(mDoc) mArray = mDoc.array(forKey: "array")! - expectExcepion(exception: .internalInconsistencyException) { + expectException(exception: .internalInconsistencyException) { let _ = mArray.toJSON() } } @@ -278,7 +278,7 @@ class ArrayTest: CBLTestCase { var blob = mDoc.blob(forKey: "origin") // before save it should throw the exception - expectExcepion(exception: .internalInconsistencyException) { + expectException(exception: .internalInconsistencyException) { print("\(blob!.content?.count ?? 0)") } try self.db.saveDocument(mDoc) diff --git a/Swift/Tests/CBLTestCase.swift b/Swift/Tests/CBLTestCase.swift index f1bfb5696..5aa06eace 100644 --- a/Swift/Tests/CBLTestCase.swift +++ b/Swift/Tests/CBLTestCase.swift @@ -274,7 +274,7 @@ class CBLTestCase: XCTestCase { } } - func expectExcepion(exception: NSExceptionName, block: @escaping () -> Void) { + func expectException(exception: NSExceptionName, block: @escaping () -> Void) { var exceptionThrown = false do { try CBLTestHelper.catchException { diff --git a/Swift/Tests/DictionaryTest.swift b/Swift/Tests/DictionaryTest.swift index 9a2c2ab23..f16d9d82d 100644 --- a/Swift/Tests/DictionaryTest.swift +++ b/Swift/Tests/DictionaryTest.swift @@ -268,7 +268,7 @@ class DictionaryTest: CBLTestCase { mDoc = doc!.toMutable() mDict = dict!.toMutable() mDict.setValue("newValueAppended", forKey: "newKeyAppended") - expectExcepion(exception: .internalInconsistencyException) { + expectException(exception: .internalInconsistencyException) { let _ = mDict.toJSON() } mDoc.setValue(mDict, forKey: "dict") @@ -282,7 +282,7 @@ class DictionaryTest: CBLTestCase { func testUnsavedMutableDictionaryToJSON() throws { let mDict = try MutableDictionaryObject(json: "{\"unsaved\":\"dict\"}") - expectExcepion(exception: .internalInconsistencyException) { + expectException(exception: .internalInconsistencyException) { let _ = mDict.toJSON() } } diff --git a/Swift/Tests/DocumentTest.swift b/Swift/Tests/DocumentTest.swift index cc361e99c..d0a757a88 100644 --- a/Swift/Tests/DocumentTest.swift +++ b/Swift/Tests/DocumentTest.swift @@ -1653,7 +1653,7 @@ class DocumentTest: CBLTestCase { func testUnsavedMutableDocumentToJSON() throws { let mDoc = try MutableDocument(id: "doc", json: "{\"unsaved\":\"doc\"}") - expectExcepion(exception: .internalInconsistencyException) { + expectException(exception: .internalInconsistencyException) { let _ = mDoc.toJSON() } } @@ -1732,7 +1732,7 @@ class DocumentTest: CBLTestCase { func testUnsavedBlob() throws { let content = kTestBlob.data(using: .utf8)! let blob = Blob(contentType: "text/plain", data: content) - expectExcepion(exception: .internalInconsistencyException) { + expectException(exception: .internalInconsistencyException) { let _ = blob.toJSON() } } @@ -1751,7 +1751,7 @@ class DocumentTest: CBLTestCase { try self.db.saveBlob(blob: blob) var b: Blob? - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { b = try! self.db.getBlob(properties: [Blob.typeProperty:"bl0b", Blob.blobDigestProperty: blob.digest! as String, Blob.blobContentType: "text/plain", @@ -1759,7 +1759,7 @@ class DocumentTest: CBLTestCase { } XCTAssertNil(b) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { b = try! self.db.getBlob(properties: ["type":Blob.blobType, Blob.blobDigestProperty: blob.digest! as String, Blob.blobContentType: "text/plain", @@ -1767,7 +1767,7 @@ class DocumentTest: CBLTestCase { } XCTAssertNil(b) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { b = try! self.db.getBlob(properties: [Blob.typeProperty:Blob.blobType, Blob.blobDigestProperty: blob.digest! as String, Blob.blobContentType: 1234, @@ -1775,7 +1775,7 @@ class DocumentTest: CBLTestCase { } XCTAssertNil(b) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { b = try! self.db.getBlob(properties: [Blob.typeProperty:Blob.blobType, Blob.blobDigestProperty: blob.digest! as String, Blob.blobContentType: "text/plain", @@ -1783,7 +1783,7 @@ class DocumentTest: CBLTestCase { } XCTAssertNil(b) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { b = try! self.db.getBlob(properties: [Blob.typeProperty:Blob.blobType, Blob.blobDigestProperty: 12, Blob.blobContentType: "text/plain", diff --git a/Swift/Tests/ReplicatorTest+Collection.swift b/Swift/Tests/ReplicatorTest+Collection.swift index 93ee82470..ad8bc9d8a 100644 --- a/Swift/Tests/ReplicatorTest+Collection.swift +++ b/Swift/Tests/ReplicatorTest+Collection.swift @@ -360,7 +360,7 @@ class ReplicatorTest_Collection: ReplicatorTest { let target = URLEndpoint(url: url) var config = ReplicatorConfiguration(target: target) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { config.addCollections([col1a, col1b]) } @@ -371,7 +371,7 @@ class ReplicatorTest_Collection: ReplicatorTest { XCTAssertEqual(config.collections.count, 1) XCTAssert(config.collections.contains(where: { $0.name == "colA" && $0.scope.name == "scopeA" })) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { config.addCollection(col1b) } } @@ -389,7 +389,7 @@ class ReplicatorTest_Collection: ReplicatorTest { let target = URLEndpoint(url: url) var config = ReplicatorConfiguration(target: target) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { config.addCollections([col1a, col1b]) } @@ -400,7 +400,7 @@ class ReplicatorTest_Collection: ReplicatorTest { XCTAssertEqual(config.collections.count, 1) XCTAssert(config.collections.contains(where: { $0.name == "colA" && $0.scope.name == "scopeA" })) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { config.addCollection(col1b) } } diff --git a/Swift/Tests/VectorSearchTest+Lazy.swift b/Swift/Tests/VectorSearchTest+Lazy.swift index 260e9230d..5fe62799c 100644 --- a/Swift/Tests/VectorSearchTest+Lazy.swift +++ b/Swift/Tests/VectorSearchTest+Lazy.swift @@ -195,7 +195,7 @@ class VectorSearchTest_Lazy : VectorSearchTest { let index = try wordsIndex() - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { _ = try? index.beginUpdate(limit: 0) } } @@ -774,55 +774,55 @@ class VectorSearchTest_Lazy : VectorSearchTest { let updater = try index.beginUpdate(limit: 10)! XCTAssertEqual(updater.count, 1) - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.string(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.int(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.int64(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.float(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.double(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.boolean(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.date(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.blob(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.dictionary(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.array(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { _ = updater.value(at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { try! updater.setVector([1.0, 2.0, 3.0], at: 1) } - expectExcepion(exception: .rangeException) { + expectException(exception: .rangeException) { updater.skipVector(at: 1) } } diff --git a/Swift/Tests/VectorSearchTest.swift b/Swift/Tests/VectorSearchTest.swift index 57d84bdf2..9bb1e87db 100644 --- a/Swift/Tests/VectorSearchTest.swift +++ b/Swift/Tests/VectorSearchTest.swift @@ -274,11 +274,11 @@ class VectorSearchTest_Main: VectorSearchTest { let config2 = VectorIndexConfiguration(expression: "vector", dimensions: 4096, centroids: 8) try wordsCollection.createIndex(withName: "words_index_2", config: config2) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { _ = VectorIndexConfiguration(expression: "vector", dimensions: 1, centroids: 8) } - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { _ = VectorIndexConfiguration(expression: "vector", dimensions: 4097, centroids: 8) } } @@ -305,11 +305,11 @@ class VectorSearchTest_Main: VectorSearchTest { let config2 = VectorIndexConfiguration(expression: "vector", dimensions: 300, centroids: 64000) try wordsCollection.createIndex(withName: "words_index_2", config: config2) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { _ = VectorIndexConfiguration(expression: "vector", dimensions: 300, centroids: 0) } - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { _ = VectorIndexConfiguration(expression: "vector", dimensions: 300, centroids: 64001) } } @@ -806,7 +806,7 @@ class VectorSearchTest_Main: VectorSearchTest { for numberOfSubq in [0, 7] { try deleteWordsIndex() config.encoding = .productQuantizer(subquantizers: UInt32(numberOfSubq), bits: 8) - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { try? self.createWordsIndex(config: config) } } @@ -874,7 +874,7 @@ class VectorSearchTest_Main: VectorSearchTest { try deleteWordsIndex() config.minTrainingSize = 10 config.maxTrainingSize = 9 - expectExcepion(exception: .invalidArgumentException) { + expectException(exception: .invalidArgumentException) { try? self.createWordsIndex(config: config) } }