Files
cocos4/tests/particle/renderer.test.ts
T
James Chen 42384e20f1 385 revert $ (#17912)
* Remove dollar suffix for private property definition.

* (\._[a-z][a-zA-Z0-9]{3,})\$ to \1

* (protected _[a-z][a-zA-Z0-9]{3,})\$ and (public _[a-z][a-zA-Z0-9]{3,})\$ to \1

* ( _[a-z][a-zA-Z0-9]{3,})\$([^0-9]) to \1\2

* Remove $ suffix manually for gfx-webgl backend.

* (public [a-z][a-zA-Z0-9]{3,})\$ to \1

* (\.[a-z][a-zA-Z0-9]{3,})\$ to \1


* Remove mangle hack.
2024-11-25 13:47:56 +08:00

24 lines
942 B
TypeScript

import { director, game } from "../../cocos/game";
import { scalableContainerManager } from "../../cocos/core/memop/scalable-container";
import { Node, Scene } from "../../cocos/scene-graph";
import { ParticleSystem } from "../../exports/particle";
test('recycle pool release', () => {
const scene = new Scene('test-scene');
director.runSceneImmediate(scene);
const node = new Node();
scene.addChild(node);
game.step();
// @ts-expect-error access private property
const beforeLength = scalableContainerManager._pools.length;
const comp = node.addComponent(ParticleSystem);
game.step();
// @ts-expect-error access private property
const currentLength = scalableContainerManager._pools.length;
expect(currentLength).toBeGreaterThan(beforeLength);
comp.destroy();
game.step();
// @ts-expect-error
expect(scalableContainerManager._pools.length).toBeLessThan(currentLength);
});