Log inGet started
·
testsuite · drop-in viewer
asset⌬ testsuitetestSuiteprimary: init.luau·part ofpackage zerojs.package·originates fromworld f63c1fe3-4…

zerojs_language.testSuite

Language and host-facing behaviour scripts rely on: optional chaining (`?.`), nullish coalescing (`??`) and the logical assignments (`??=`, `||=`, `&&=`), what an error prints as, what `console` writes for an object, an array or an error, and what `Date.now()` and `performance.no…

byzero-proxy @ DESKTOP-DB3UJOJ·posted 1mo ago
What it does

zerojs_language tests

Language and host-facing behaviour scripts rely on: optional chaining (?.), nullish coalescing (??) and the logical assignments (??=, ||=, &&=), what an error prints as, what console writes for an object, an array or an error, and what Date.now() and performance.now() read.

Every language case runs on both tiers a VM can execute with, the compiled tier and the interpreter, and expects the same answer from each.

TestWhat it holds
optional_chaining_reads_through_nila?.b, a?.[k], f?.(x) give undefined for a null or undefined base, skip the rest of the chain and the arguments, keep this, and parse a?.5:1 as a conditional.
optional_chaining_is_refused_as_a_targetA chain is a SyntaxError as an assignment, update or new target and before a tagged template.
nullish_coalescing_keeps_false_and_zero?? replaces only null and undefined, never evaluates its right side otherwise, and refuses mixing with || and && unparenthesised.
logical_assignment_assigns_only_when_it_applies??=, ||= and &&= evaluate the right side and write only when the current value calls for it.
an_error_prints_its_messageString(e), `${e}`, "" + e and e.toString() read <name>: <message> for built-in errors and errors the runtime raises.
console_log_prints_objects_and_arrays_readablyobjects, arrays, nested values, errors, functions, Map, Set and cycles print the way a JavaScript console prints them, bounded in depth and length.
date_now_moves_within_one_frameDate.now() follows the wall clock between two reads with no engine frame between them.
date_now_tracks_the_wall_clockDate.now() stays inside the wall second os.time() reports.
date_now_moves_across_an_awaitDate.now() read before and after an awaited timer differs by about the timer.
performance_now_is_monotonicperformance.now() never goes backwards and counts milliseconds.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

The JavaScript that scripts written for ZeroJS can rely on: optional chaining, nullish coalescing and the logical assignments, what an error prints as, what `console.log` writes, and what `Date.now()` and `performance.now()` read. Each language case runs on the compiled tier and on the interpreter, and both must give the same answer.

run(tier: string, source: string) → any

A fresh VM on `tier` that has run `source`, returning what it completed with.

argtypedescription
tierstring
sourcestring

failure(tier: string, source: string) → string

The error text a run raises, or nil when it completed.

argtypedescription
tierstring
sourcestring

expectBoth(source: string, want: any) → void

Run `source` on both tiers and expect `want` from each. A mismatch names the tier and the source.

argtypedescription
sourcestring
wantany

expectBothRaise(source: string, kind: string) → void

Expect `source` to raise an error containing `kind` on both tiers.

argtypedescription
sourcestring
kindstring

spin(seconds: number) → void

Busy-wait `seconds` of wall time without yielding to the engine, so no frame passes between the reads on either side.

argtypedescription
secondsnumber

consoleLines(tier: string, source: string) → void

Run `source` on a VM on `tier` whose console writes into the returned list.

argtypedescription
tierstring
sourcestring

sink(text: string) → void

argtypedescription
textstring

one(source: string) → string

argtypedescription
sourcestring

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.