-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
97 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,14 @@ jobs: | |
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run monitor tests | ||
run: xcodebuild -workspace JoyStickView.xcworkspace test -destination 'name=iPhone 11' -scheme 'JoyStickView' | ||
- name: Run view tests | ||
run: xcodebuild -workspace JoyStickView.xcworkspace test -destination 'name=iPhone 11' -scheme 'JoyStickView App' | ||
- name: Build, test, and code coverage | ||
run make | ||
- name: Create Coverage Badge | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.GIST_UPDATE }} | ||
gistID: 4739895cbf46573cc4b63ab776c74899 | ||
filename: Joystick-coverage.json | ||
label: Coverage | ||
message: ${{ env.PERCENTAGE }} | ||
color: success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright © 2023 Brad Howes. All rights reserved. | ||
|
||
import XCTest | ||
import JoyStickView | ||
|
||
class BundleAdditionsTests: XCTestCase { | ||
|
||
func testPodResource() { | ||
let main = Bundle.main | ||
for bundle in Bundle.allBundles { | ||
_ = main.podResource(name: bundle.description) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright © 2023 Brad Howes. All rights reserved. | ||
|
||
import XCTest | ||
import JoyStickView | ||
|
||
class CoreGraphicsAdditionsTests: XCTestCase { | ||
|
||
func testCGRectMid() { | ||
let rect = CGRect(x: 0, y: 0, width: 100, height: 220) | ||
XCTAssertEqual(rect.mid, CGPoint(x: 50, y: 110)) | ||
} | ||
|
||
func testCGVectorMagnitude() { | ||
let v1 = CGVector(dx: 1.23, dy: 4.5) | ||
XCTAssertEqual(v1.magnitude, sqrt(v1.dx * v1.dx + v1.dy * v1.dy)) | ||
} | ||
|
||
func testCGVectorMagnitudeSquared() { | ||
let v1 = CGVector(dx: 1.23, dy: 4.5) | ||
XCTAssertEqual(v1.magnitude2, v1.dx * v1.dx + v1.dy * v1.dy) | ||
} | ||
|
||
func testCGPointPlusCGVector() { | ||
let p1 = CGPoint(x: 1.2, y: 3.4) | ||
let v1 = CGVector(dx: 5.6, dy: 7.8) | ||
XCTAssertEqual(p1 + v1, CGPoint(x: p1.x + v1.dx, y: p1.y + v1.dy)) | ||
} | ||
|
||
func testCGPointPlusCGSize() { | ||
let p1 = CGPoint(x: 1.2, y: 3.4) | ||
let s1 = CGSize(width: 5.6, height: 7.8) | ||
XCTAssertEqual(p1 + s1, CGPoint(x: p1.x + s1.width, y: p1.y + s1.height)) | ||
} | ||
|
||
func testCGPointMinusCGVector() { | ||
let p1 = CGPoint(x: 1.2, y: 3.4) | ||
let v1 = CGVector(dx: 5.6, dy: 7.8) | ||
XCTAssertEqual(p1 - v1, CGPoint(x: p1.x - v1.dx, y: p1.y - v1.dy)) | ||
} | ||
|
||
func testCGPointMinusCGPoint() { | ||
let p1 = CGPoint(x: 1.2, y: 3.4) | ||
let p2 = CGPoint(x: 5.6, y: 7.8) | ||
XCTAssertEqual(p1 - p2, CGVector(dx: p1.x - p2.x, dy: p1.y - p2.y)) | ||
} | ||
} |