-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-mat3.spec.ts
28 lines (24 loc) · 1.02 KB
/
simple-mat3.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { expect } from "chai";
import "mocha";
import { Mat3 } from "./mat3";
describe("Mat3", () => {
describe("init", () => {
it("Test matrix creation", () => {
const emptyMatrix = [
1, 0, 0,
0, 1, 0,
0, 0, 1,
];
expect(Mat3.create().equalsArray(emptyMatrix)).to.be.true;
expect(Mat3.create().equals(Mat3.create())).to.be.true;
expect(Mat3.create().equals(null as any)).to.be.false;
expect(Mat3.create().equals({} as any)).to.be.false;
expect(Mat3.fromTranslation(0, 0).equals(Mat3.create())).to.be.true;
expect(Mat3.fromScale(1, 1).equals(Mat3.create())).to.be.true;
expect(Mat3.fromScale(1, 1)).to.deep.equal(Mat3.create());
expect(Mat3.fromTranslation(0, 0)).to.deep.equal(Mat3.create());
// // commented because error during comparison 0 and -0
// expect(Mat3.fromRotation(0)).to.deep.equal(Mat3.create());
});
});
});