@rezless/vitest 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -109,7 +109,7 @@ Calls to functions that aren't built in or defined by the script fail to load, a
|
|
|
109
109
|
// Drive events
|
|
110
110
|
s.start() // run state_entry of default
|
|
111
111
|
s.fire(eventName, payload) // payload binds to handler params by spec name
|
|
112
|
-
s.advanceTime(ms) // advance virtual clock;
|
|
112
|
+
s.advanceTime(ms) // advance virtual clock by exactly ms; runs everything due by then
|
|
113
113
|
s.deliverChat({ channel, name, key, message }) // fire `listen` on matching active listens
|
|
114
114
|
s.respondToHttp(key, { status, body }) // fire `http_response` for a captured llHTTPRequest
|
|
115
115
|
s.respondToLastHttp({ status, body }) // same, for the most recent
|
|
@@ -141,6 +141,7 @@ s.seedLinksetData(entries) // pre-populate LSD without firi
|
|
|
141
141
|
s.text // current llSetText: { text, color, alpha } or null
|
|
142
142
|
s.objectDesc // current llSetObjectDesc value
|
|
143
143
|
s.dead // true once llDie has run
|
|
144
|
+
s.wakeAt // virtual ms a sleeping handler wakes at, or undefined when idle
|
|
144
145
|
|
|
145
146
|
// Multi-script context (auto-allocated for single-script tests)
|
|
146
147
|
s.host // the Prim instance hosting this script
|
|
@@ -148,6 +149,12 @@ s.linkset // the Linkset (shared clock, LS
|
|
|
148
149
|
s.scriptName // inventory name; backs llGetScriptName
|
|
149
150
|
```
|
|
150
151
|
|
|
152
|
+
`start`, `fire`, `reset`, `deliverChat`, `grantPermissions` and the `respondTo*` calls return only after the handlers they started have finished; if one sleeps, the clock moves to its wake time while the other scripts keep running.
|
|
153
|
+
|
|
154
|
+
`advanceTime(ms)` stops the clock exactly `ms` later, so a handler still sleeping at that point stays asleep and carries on during a later `advanceTime`. This is a breaking change: before, one call ran the whole sleep.
|
|
155
|
+
|
|
156
|
+
A mock can take time like a builtin delay by calling `ctx.sleep(ms)`; the script pauses for that long after the mock returns.
|
|
157
|
+
|
|
151
158
|
### `loadLinkset(input)` → `Promise<LoadedLinkset>`
|
|
152
159
|
|
|
153
160
|
For tests that exercise more than one script — sibling scripts in the same
|
|
@@ -252,7 +259,7 @@ honored centrally in the dispatcher. Pass `stubs: 'warn'` or
|
|
|
252
259
|
|
|
253
260
|
* **chat**: `llSay`, `llShout`, `llWhisper`, `llOwnerSay`
|
|
254
261
|
* **listen**: `llListen`, `llListenRemove`, `llListenControl`
|
|
255
|
-
* **time**: `llSetTimerEvent`, `llSleep
|
|
262
|
+
* **time**: `llSetTimerEvent`, `llSleep` (other scripts keep running while one sleeps), `llGetTime`, `llGetAndResetTime`, `llResetTime`, `llGetUnixTime`, `llGetTimestamp`, `llGetDate` (start at `startUnixTime` and move with the virtual clock), `llGetRegionTimeDilation` (always 1.0)
|
|
256
263
|
* **HTTP**: `llHTTPRequest`, `llHTTPResponse`
|
|
257
264
|
* **linked**: `llMessageLinked` (full `LINK_THIS` / `LINK_SET` / `LINK_ALL_OTHERS` / `LINK_ALL_CHILDREN` / `LINK_ROOT` / specific-link routing across the linkset, with correct `sender_num`)
|
|
258
265
|
* **link info**: `llGetLinkNumber`, `llGetNumberOfPrims`, `llGetLinkKey`, `llGetLinkName`
|
|
@@ -266,13 +273,13 @@ honored centrally in the dispatcher. Pass `stubs: 'warn'` or
|
|
|
266
273
|
* **hash**: `llMD5String`, `llSHA1String`, `llSHA256String`, `llHMAC`
|
|
267
274
|
* **base64**: `llStringToBase64`/`Base64ToString`, `llIntegerToBase64`/`Base64ToInteger`, `llXorBase64`
|
|
268
275
|
* **object**: `llSetText`, `llSetObjectDesc`, `llGetObjectDesc`, `llDie` (kills every script in the linkset), `llResetScript`
|
|
269
|
-
* **inventory**: `llGetInventoryNumber`/`Name`/`Type`/`Key`/`Creator`/`Desc`/`AcquireTime`/`PermMask` against the host prim's inventory; notecards via `llGetNotecardLine` / `llGetNumberOfNotecardLines` (correct EOF / NAK semantics, ISO 8601 UTC acquire-time strings); `llRemoveInventory` (a script that removes itself
|
|
276
|
+
* **inventory**: `llGetInventoryNumber`/`Name`/`Type`/`Key`/`Creator`/`Desc`/`AcquireTime`/`PermMask` against the host prim's inventory; notecards via `llGetNotecardLine` / `llGetNumberOfNotecardLines` (correct EOF / NAK semantics, ISO 8601 UTC acquire-time strings); `llRemoveInventory` (a script that removes itself halts at once)
|
|
270
277
|
* **permissions**: `llRequestPermissions`, `llGetPermissions`, `llGetPermissionsKey` — answer requests with `s.grantPermissions` / `s.denyPermissions`
|
|
271
278
|
* **script memory**: `llGetUsedMemory`, `llGetFreeMemory`, `llGetMemoryLimit`, `llSetMemoryLimit`, `llScriptProfiler`, `llGetSPMaxMemory` — rough numbers, not Second Life's. rezless guesses at code, globals, locals and the call stack, and the guess can be far off: in one comparison, real scripts used 1.7 to 2.8 times more memory in-world than rezless reported. The `memoryLimit` crash uses the same guess. Don't rely on either to tell you whether a script fits in its memory limit; check that in-world.
|
|
272
279
|
* **script control**: `llResetOtherScript`, `llSetScriptState`, `llGetScriptState` — pausing parks events for replay on resume, and the timer cadence realigns on resume so paused scripts don't get a flood of catch-up timer events
|
|
273
280
|
* **linkset data**: `llLinksetDataWrite`/`Read`/`Delete`/`WriteProtected`/`ReadProtected`/`DeleteProtected`/`DeleteFound`, `llLinksetDataReset`, `llLinksetDataAvailable`, `llLinksetDataCountKeys`/`CountFound`, `llLinksetDataListKeys`/`FindKeys` — fires the `linkset_data` event on every script in the linkset with `LINKSETDATA_UPDATE` / `DELETE` / `RESET` / `MULTIDELETE`. The store survives `llResetScript`. Inspect via `s.linksetData` (a `ReadonlyMap<string, { value, password }>`); pre-populate via `s.seedLinksetData([['k', { value: 'v' }]])`.
|
|
274
281
|
* **primitive params**: `llSetPrimitiveParams`, `llSetLinkPrimitiveParams`, `llSetLinkPrimitiveParamsFast`, `llGetPrimitiveParams`, `llGetLinkPrimitiveParams` — full `PRIM_*` rule surface (position / rotation / size / colour / alpha / texture / glow / fullbright / material / physics / flexible / point light / projector / sculpt / GLTF PBR / sit target / click action / text / name / desc / omega / damage / temp-on-rez / cast shadows / …). Honors `PRIM_LINK_TARGET` mid-rule redirects, `ALL_SIDES` expansion, multi-prim get concatenation, unknown-rule termination on get, and the 0.2 s delay on the slow link variant.
|
|
275
|
-
* **prim accessors** (alternative single-rule shortcuts that read/write the same backing store): `llSetPos`/`llGetPos`/`llGetLocalPos`/`llGetRootPosition`, `llSetRot`/`llSetLocalRot`/`llGetRot`/`llGetLocalRot`/`llGetRootRotation`, `llSetScale`/`llGetScale`/`llScaleByFactor`/`llGetMaxScaleFactor`/`llGetMinScaleFactor`, `llSetColor`/`llGetColor`/`llSetAlpha`/`llGetAlpha`, `llSetTexture`/`llGetTexture`/`llGetTextureOffset`/`llGetTextureScale`/`llGetTextureRot`/`llScaleTexture`/`llOffsetTexture`/`llRotateTexture`, `llSetLinkColor`/`llSetLinkAlpha`/`llSetLinkTexture`, `llSetTextureAnim`/`llSetLinkTextureAnim`/`llSetLinkTextureAnimOverrideMe`, `llSetRenderMaterial`/`llGetRenderMaterial`, `llSetStatus`/`llGetStatus`/`llSetLinkStatus`, `llSetClickAction`, `llTargetOmega`, `llSetPhysicsMaterial`/`llGetPhysicsMaterial`, `llPassCollisions`/`llPassTouches`, `llSitTarget`/`llLinkSitTarget`/`llAvatarOnSitTarget`/`llAvatarOnLinkSitTarget`/`llSetLinkSitFlags`/`llGetLinkSitFlags`.
|
|
282
|
+
* **prim accessors** (alternative single-rule shortcuts that read/write the same backing store): `llSetPos`/`llGetPos`/`llGetLocalPos`/`llGetRootPosition`, `llSetRot`/`llSetLocalRot`/`llGetRot`/`llGetLocalRot`/`llGetRootRotation`, `llSetScale`/`llGetScale`/`llScaleByFactor`/`llGetMaxScaleFactor`/`llGetMinScaleFactor`, `llSetColor`/`llGetColor`/`llSetAlpha`/`llGetAlpha`, `llSetTexture`/`llGetTexture`/`llGetTextureOffset`/`llGetTextureScale`/`llGetTextureRot`/`llScaleTexture`/`llOffsetTexture`/`llRotateTexture`, `llSetLinkColor`/`llSetLinkAlpha`/`llSetLinkTexture`, `llSetTextureAnim`/`llSetLinkTextureAnim`/`llSetLinkTextureAnimOverrideMe`, `llSetRenderMaterial`/`llGetRenderMaterial`/`llSetLinkGLTFOverrides`, `llSetStatus`/`llGetStatus`/`llSetLinkStatus`, `llSetClickAction`, `llTargetOmega`, `llSetPhysicsMaterial`/`llGetPhysicsMaterial`, `llPassCollisions`/`llPassTouches`, `llSitTarget`/`llLinkSitTarget`/`llAvatarOnSitTarget`/`llAvatarOnLinkSitTarget`/`llSetLinkSitFlags`/`llGetLinkSitFlags`.
|
|
276
283
|
|
|
277
284
|
The full LSL constant surface (every `PRIM_*`, `STATUS_*`, `LINK_*`,
|
|
278
285
|
`INVENTORY_*`, `MASK_*`, `LINKSETDATA_*`, …) is re-exported from
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rezless/vitest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Vitest-style DSL for testing Linden Scripting Language (LSL) scripts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "i-doll",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@rezless/vm": "0.
|
|
56
|
-
"@rezless/parser": "0.
|
|
55
|
+
"@rezless/vm": "0.7.0",
|
|
56
|
+
"@rezless/parser": "0.7.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"vitest": "^5.0.5"
|