Skip to content

Commit

Permalink
fix typos (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiftechnify authored May 29, 2024
1 parent 2bb6c48 commit cfff039
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Sources/CentralManager/CentralManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
46 changes: 23 additions & 23 deletions Tests/PeripheralDataConversionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(of value: T) where T: PeripheralDataConvertible & Equatable {
private static func assertRoundtripConversion<T>(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
Expand Down

0 comments on commit cfff039

Please sign in to comment.