[Math] Add test that Matrix init throws for invalid values array
This commit is contained in:
parent
94b12cc2ba
commit
1d1e5134d8
3 changed files with 27 additions and 2 deletions
|
@ -20,6 +20,19 @@ class Matrix4Tests: XCTestCase {
|
|||
XCTAssertEqual(Matrix4.count, 16)
|
||||
XCTAssertEqual(Matrix4().data.count, Matrix4.count)
|
||||
}
|
||||
|
||||
func testThatInitThrowsForInvalidSizeOfValuesArray() {
|
||||
do {
|
||||
let m = try Matrix4(values: [])
|
||||
-m
|
||||
XCTFail()
|
||||
} catch MatrixError.InvalidSize(let given, let expected) {
|
||||
XCTAssertEqual(given, 0)
|
||||
XCTAssertEqual(expected, Matrix4.count)
|
||||
} catch {
|
||||
XCTFail()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Matrix4SubscriptTests: XCTestCase {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue