-
Notifications
You must be signed in to change notification settings - Fork 15
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
7 changed files
with
149 additions
and
83 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
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 |
---|---|---|
@@ -1,19 +1,29 @@ | ||
import { Vector2 } from "./Vector2"; | ||
|
||
test("Instancing", () => { | ||
const a = new Vector2(); | ||
expect(a.x).toBe(0); | ||
expect(a.y).toBe(0); | ||
describe("Vector2", () => { | ||
test("constructor defaults", () => { | ||
const a = new Vector2(); | ||
expect(a.x).toBe(0); | ||
expect(a.y).toBe(0); | ||
}); | ||
|
||
const b = new Vector2(1, 2); | ||
expect(b.x).toBe(1); | ||
expect(b.y).toBe(2); | ||
test("constructor values", () => { | ||
const b = new Vector2(1, 2); | ||
expect(b.x).toBe(1); | ||
expect(b.y).toBe(2); | ||
}); | ||
|
||
const c = b.clone(); | ||
expect(c.x).toBe(1); | ||
expect(c.y).toBe(2); | ||
test("clone", () => { | ||
const b = new Vector2(1, 2); | ||
const c = b.clone(); | ||
expect(c.x).toBe(1); | ||
expect(c.y).toBe(2); | ||
}); | ||
|
||
const d = new Vector2().copy(b); | ||
expect(d.x).toBe(1); | ||
expect(d.y).toBe(2); | ||
test("copy", () => { | ||
const b = new Vector2(1, 2); | ||
const d = new Vector2().copy(b); | ||
expect(d.x).toBe(1); | ||
expect(d.y).toBe(2); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,23 +1,31 @@ | ||
import { Vector3 } from "./Vector3"; | ||
|
||
test("Instancing", () => { | ||
const a = new Vector3(); | ||
expect(a.r).toBe(0); | ||
expect(a.g).toBe(0); | ||
expect(a.b).toBe(0); | ||
describe("Vector3", () => { | ||
test("constructor defaults", () => { | ||
const a = new Vector3(); | ||
expect(a.r).toBe(0); | ||
expect(a.g).toBe(0); | ||
expect(a.b).toBe(0); | ||
}); | ||
|
||
const b = new Vector3(1, 2, 3); | ||
expect(b.r).toBe(1); | ||
expect(b.g).toBe(2); | ||
expect(b.b).toBe(3); | ||
|
||
const c = b.clone(); | ||
expect(c.x).toBe(1); | ||
expect(c.y).toBe(2); | ||
expect(c.z).toBe(3); | ||
|
||
const d = new Vector3().copy(b); | ||
expect(d.x).toBe(1); | ||
expect(d.y).toBe(2); | ||
expect(d.z).toBe(3); | ||
test("constructor values", () => { | ||
const b = new Vector3(1, 2, 3); | ||
expect(b.r).toBe(1); | ||
expect(b.g).toBe(2); | ||
expect(b.b).toBe(3); | ||
}); | ||
test("clone", () => { | ||
const b = new Vector3(1, 2, 3); | ||
const c = b.clone(); | ||
expect(c.x).toBe(1); | ||
expect(c.y).toBe(2); | ||
expect(c.z).toBe(3); | ||
}); | ||
test("copy", () => { | ||
const b = new Vector3(1, 2, 3); | ||
const d = new Vector3().copy(b); | ||
expect(d.x).toBe(1); | ||
expect(d.y).toBe(2); | ||
expect(d.z).toBe(3); | ||
}); | ||
}); |
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,35 @@ | ||
import { Vector4 } from "./Vector4"; | ||
|
||
describe("Vector4", () => { | ||
test("constructor defaults", () => { | ||
const a = new Vector4(); | ||
expect(a.x).toBe(0); | ||
expect(a.y).toBe(0); | ||
expect(a.z).toBe(0); | ||
expect(a.w).toBe(0); | ||
}); | ||
|
||
test("constructor values", () => { | ||
const b = new Vector4(1, 2, 3, 4); | ||
expect(b.x).toBe(1); | ||
expect(b.y).toBe(2); | ||
expect(b.z).toBe(3); | ||
expect(b.w).toBe(4); | ||
}); | ||
test("clone", () => { | ||
const b = new Vector4(1, 2, 3, 4); | ||
const c = b.clone(); | ||
expect(c.x).toBe(1); | ||
expect(c.y).toBe(2); | ||
expect(c.z).toBe(3); | ||
expect(c.w).toBe(4); | ||
}); | ||
test("copy", () => { | ||
const b = new Vector4(1, 2, 3, 4); | ||
const d = new Vector4().copy(b); | ||
expect(d.x).toBe(1); | ||
expect(d.y).toBe(2); | ||
expect(d.z).toBe(3); | ||
expect(d.w).toBe(4); | ||
}); | ||
}); |