Skip to content

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
velicuvlad committed Oct 4, 2024
1 parent aac8537 commit b850ea6
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 45 deletions.
1 change: 1 addition & 0 deletions Objective-C/Internal/CBLQueryIndex+Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype) initWithC4Index: (C4Index*) c4index
name: (NSString*) name
collection: (CBLCollection*) collection;

@end

NS_ASSUME_NONNULL_END
8 changes: 0 additions & 8 deletions Objective-C/Tests/CollectionTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
6 changes: 3 additions & 3 deletions Swift/Tests/ArrayTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand All @@ -244,7 +244,7 @@ class ArrayTest: CBLTestCase {
try saveDocument(mDoc)

mArray = mDoc.array(forKey: "array")!
expectExcepion(exception: .internalInconsistencyException) {
expectException(exception: .internalInconsistencyException) {
let _ = mArray.toJSON()
}
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Swift/Tests/CBLTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions Swift/Tests/DictionaryTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()
}
}
Expand Down
14 changes: 7 additions & 7 deletions Swift/Tests/DocumentTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down Expand Up @@ -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()
}
}
Expand All @@ -1751,39 +1751,39 @@ 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",
Blob.blobLengthProperty: blob.length])
}
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",
Blob.blobLengthProperty: blob.length])
}
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,
Blob.blobLengthProperty: blob.length])
}
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",
Blob.blobLengthProperty: "12"])
}
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",
Expand Down
8 changes: 4 additions & 4 deletions Swift/Tests/ReplicatorTest+Collection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}

Expand All @@ -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)
}
}
Expand All @@ -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])
}

Expand All @@ -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)
}
}
Expand Down
28 changes: 14 additions & 14 deletions Swift/Tests/VectorSearchTest+Lazy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class VectorSearchTest_Lazy : VectorSearchTest {

let index = try wordsIndex()

expectExcepion(exception: .invalidArgumentException) {
expectException(exception: .invalidArgumentException) {
_ = try? index.beginUpdate(limit: 0)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down
12 changes: 6 additions & 6 deletions Swift/Tests/VectorSearchTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit b850ea6

Please sign in to comment.