From cfff03949484d2ff9c5e94dcf68a240c14bd616d Mon Sep 17 00:00:00 2001 From: Takumi Fujiwara Date: Wed, 29 May 2024 09:46:37 +0900 Subject: [PATCH] fix typos (#50) --- README.md | 4 +- Sources/CentralManager/CentralManager.swift | 4 +- Tests/PeripheralDataConversionTests.swift | 46 ++++++++++----------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 5812d8c..7d7810e 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ peripheral.characteristicValueUpdatedPublisher .store(in: &cancellables) ``` -Remember that you should enable notifications on that characteristc to receive updated values. +Remember that you should enable notifications on that characteristic to receive updated values. ```swift try await peripheral.setNotifyValue(true, characteristicUUID, serviceUUID) @@ -170,7 +170,7 @@ to your Package Dependencies. - iOS 14.0+ - MacOS 11.0+ - Swift 5 -- Xcoce 13.2.1+ +- Xcode 13.2.1+ ## License diff --git a/Sources/CentralManager/CentralManager.swift b/Sources/CentralManager/CentralManager.swift index 4ccacbd..825941a 100644 --- a/Sources/CentralManager/CentralManager.swift +++ b/Sources/CentralManager/CentralManager.swift @@ -89,7 +89,7 @@ public class CentralManager { Task { // Note that the enqueue call will remain awaiting until the stream is terminated. This // means that we can end up in a state were the continuation is used to send the stream, - // and yet we want to throw an error (e.g. calling `cancellAllOperations` while scanning). + // and yet we want to throw an error (e.g. calling `cancelAllOperations` while scanning). // To avoid crashing, we check whether the continuation has been used before. var isContinuationUsed = false @@ -193,7 +193,7 @@ public class CentralManager { } /// Creates the async stream where scan data will get added as part of scanning for peripherals. - /// - Note: The stream is responsable for starting scan. + /// - Note: The stream is responsible for starting scan. private func createScanDataStream( withServices serviceUUIDs: [CBUUID]?, options: [String : Any]? = nil diff --git a/Tests/PeripheralDataConversionTests.swift b/Tests/PeripheralDataConversionTests.swift index e7aee81..095721d 100644 --- a/Tests/PeripheralDataConversionTests.swift +++ b/Tests/PeripheralDataConversionTests.swift @@ -6,59 +6,59 @@ class PeripheralDataConversionTests: XCTestCase { // MARK: String - func testRoundtripConvertionOfStringEmpty() { - Self.assertRoundtripConvertion(of: "") + func testRoundtripConversionOfStringEmpty() { + Self.assertRoundtripConversion(of: "") } - func testRoundtripConvertionOfString() { - Self.assertRoundtripConvertion(of: "Lorem ipsum dolor sit amet") + func testRoundtripConversionOfString() { + Self.assertRoundtripConversion(of: "Lorem ipsum dolor sit amet") } // MARK: Booleans - func testRoundtripConvertionOfBooleanTrue() { - Self.assertRoundtripConvertion(of: true) + func testRoundtripConversionOfBooleanTrue() { + Self.assertRoundtripConversion(of: true) } - func testRoundtripConvertionOfBooleanFalse() { - Self.assertRoundtripConvertion(of: false) + func testRoundtripConversionOfBooleanFalse() { + Self.assertRoundtripConversion(of: false) } // MARK: Integer - func testRoundtripConvertionOfInteger0() { - Self.assertRoundtripConvertion(of: 0) + func testRoundtripConversionOfInteger0() { + Self.assertRoundtripConversion(of: 0) } - func testRoundtripConvertionOfIntegerWithPositiveValue() { - Self.assertRoundtripConvertion(of: 1800) + func testRoundtripConversionOfIntegerWithPositiveValue() { + Self.assertRoundtripConversion(of: 1800) } - func testRoundtripConvertionOfIntegerWithNegativeValue() { - Self.assertRoundtripConvertion(of: -900) + func testRoundtripConversionOfIntegerWithNegativeValue() { + Self.assertRoundtripConversion(of: -900) } // MARK: Float - func testRoundtripConvertionOfFloat0() { - Self.assertRoundtripConvertion(of: 0.0 as Float) + func testRoundtripConversionOfFloat0() { + Self.assertRoundtripConversion(of: 0.0 as Float) } - func testRoundtripConvertionOfFloatWithPositiveValue() { - Self.assertRoundtripConvertion(of: 1800) + func testRoundtripConversionOfFloatWithPositiveValue() { + Self.assertRoundtripConversion(of: 1800) } - func testRoundtripConvertionOfFloatWithNegativeValue() { - Self.assertRoundtripConvertion(of: -900) + func testRoundtripConversionOfFloatWithNegativeValue() { + Self.assertRoundtripConversion(of: -900) } - func testRoundtripConvertionOfFloatWithDecimals() { - Self.assertRoundtripConvertion(of: -3.14159265359 as Float) + func testRoundtripConversionOfFloatWithDecimals() { + Self.assertRoundtripConversion(of: -3.14159265359 as Float) } // MARK: Utils /// Asserts that the given value can be converted to data and back to the original value. - private static func assertRoundtripConvertion(of value: T) where T: PeripheralDataConvertible & Equatable { + private static func assertRoundtripConversion(of value: T) where T: PeripheralDataConvertible & Equatable { guard let data = value.toData() else { XCTFail("Failed to convert value \(value) of type \(T.self) to Data") return