-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
22 changed files
with
483 additions
and
245 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -25,4 +25,4 @@ | |
"type": "git", | ||
"url": "git+https://github.com/Next2D/Player.git" | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/cache/src/CacheStore/service/CacheStoreGenerateFilterKeysService.test.ts
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,15 @@ | ||
import { execute } from "./CacheStoreGenerateFilterKeysService"; | ||
import { describe, expect, it } from "vitest"; | ||
|
||
describe("CacheStoreGenerateFilterKeysService.js test", () => | ||
{ | ||
it("test case1", () => | ||
{ | ||
expect(execute(1, 0, 0, 1)).toBe(1507424); | ||
}); | ||
|
||
it("test case2", () => | ||
{ | ||
expect(execute(0.25, 0.5, -0.3, 1.25)).toBe(-1648357538); | ||
}); | ||
}); |
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,18 @@ | ||
import { $maps, $poolMap, $getMap } from "./CacheUtil"; | ||
import { describe, expect, it } from "vitest"; | ||
|
||
describe("CacheUtil.js test", () => | ||
{ | ||
it("test case", () => | ||
{ | ||
$maps.length = 0; | ||
expect($maps.length).toBe(0); | ||
|
||
const map = $getMap(); | ||
$poolMap(map); | ||
expect($maps.length).toBe(1); | ||
|
||
$getMap(); | ||
expect($maps.length).toBe(0); | ||
}); | ||
}); |
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
36 changes: 36 additions & 0 deletions
36
packages/display/src/DisplayObject/service/DisplayObjectApplyChangesService.test.ts
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,36 @@ | ||
import { execute } from "./DisplayObjectApplyChangesService"; | ||
import { DisplayObject } from "../../DisplayObject"; | ||
import { $parentMap } from "../../DisplayObjectUtil"; | ||
import { describe, expect, it } from "vitest"; | ||
|
||
describe("DisplayObjectApplyChangesService.js test", () => | ||
{ | ||
it("execute test case1", () => | ||
{ | ||
const displayObject = new DisplayObject(); | ||
|
||
displayObject.changed = false; | ||
expect(displayObject.changed).toBe(false); | ||
|
||
execute(displayObject); | ||
expect(displayObject.changed).toBe(true); | ||
}); | ||
|
||
it("execute test case2", () => | ||
{ | ||
const displayObject = new DisplayObject(); | ||
const parent = new DisplayObject(); | ||
$parentMap.set(displayObject, parent); | ||
|
||
parent.changed = false; | ||
displayObject.changed = false; | ||
expect(parent.changed).toBe(false); | ||
expect(displayObject.changed).toBe(false); | ||
|
||
execute(displayObject); | ||
expect(parent.changed).toBe(true); | ||
expect(displayObject.changed).toBe(true); | ||
|
||
$parentMap.delete(displayObject); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
packages/display/src/DisplayObject/service/DisplayObjectBlendToNumberService.test.ts
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,24 @@ | ||
import { execute } from "./DisplayObjectBlendToNumberService"; | ||
import { describe, expect, it } from "vitest"; | ||
|
||
describe("DisplayObjectBlendToNumberService.js test", () => | ||
{ | ||
it("execute test case", () => | ||
{ | ||
expect(execute("copy")).toBe(0); | ||
expect(execute("add")).toBe(1); | ||
expect(execute("alpha")).toBe(2); | ||
expect(execute("darken")).toBe(3); | ||
expect(execute("difference")).toBe(4); | ||
expect(execute("erase")).toBe(5); | ||
expect(execute("hardlight")).toBe(6); | ||
expect(execute("invert")).toBe(7); | ||
expect(execute("layer")).toBe(8); | ||
expect(execute("lighten")).toBe(9); | ||
expect(execute("multiply")).toBe(10); | ||
expect(execute("normal")).toBe(11); | ||
expect(execute("overlay")).toBe(12); | ||
expect(execute("screen")).toBe(13); | ||
expect(execute("subtract")).toBe(14); | ||
}); | ||
}); |
Oops, something went wrong.