-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more tests for textures and tap actions.
- Loading branch information
1 parent
6cdb6d2
commit 9afec10
Showing
4 changed files
with
64 additions
and
3 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
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,40 @@ | ||
// | ||
// RUITextureTests.swift | ||
// | ||
// | ||
// Created by Max Cobb on 29/01/2023. | ||
// | ||
|
||
import XCTest | ||
import RealityKit | ||
@testable import RealityUI | ||
|
||
@available(iOS 15.0, macOS 12, *) | ||
final class RUITextureTests: XCTestCase { | ||
|
||
|
||
override func setUpWithError() throws { | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
} | ||
|
||
func testBasicTexture() async throws { | ||
let tex = try await RUITexture.generateTexture(systemName: "pencil", pointSize: 20) | ||
let xcMainThread = XCTestExpectation(description: "main async called") | ||
DispatchQueue.main.async { | ||
XCTAssertEqual(tex.width, 48, accuracy: 1) | ||
XCTAssertEqual(tex.height, 48, accuracy: 1) | ||
xcMainThread.fulfill() | ||
} | ||
await fulfillment(of: [xcMainThread]) | ||
} | ||
|
||
func testInvalidTexture() async throws { | ||
do { | ||
_ = try await RUITexture.generateTexture(systemName: "|nv@中id") | ||
} catch let err as RUITexture.TextureError { | ||
XCTAssertEqual(err, .invalidSystemName) | ||
} | ||
} | ||
} |
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