Tests / @ogygia/machine

@ogygia/machine

Version 0.14.0 latest
commit 620ddcca
1,082 test runs (549 tests, each run in Node, the browsers or both)
1.59× lines of test for each line of source (8,112 to 5,087) Only real test code counts: test files and their helpers, not fixtures, sample apps or benches. Blank lines are left out on both sides.
Exactly what is counted non-blank lines of test code across the repo (*.test.ts, *.test-d.ts, *.spec.ts, and the .ts helpers in test/ and e2e/ folders; no fixtures, fixture apps, stubs or benches), over non-blank lines of packages/*/src (no .d.ts or generated files)
96.8% of source lines run by the tests
  • 549Unit
  • 533Browser
  • 0End to end
  • 0Type tests
  • 0Lint rules
  • 0Failing

Coverage

  • 96.8%Lines
  • 94.3%Branches
  • 91.3%Functions
  • 96.3%Statements

Every test

549 tests

TestKindNodeChromiumFirefoxWebKit
packages/machine/test/after.test.ts
after: a state that ends on its own > a cleanup that throws during the timed step is reported, and the step is still takenUnit, Browserpasspasspasspass
after: a state that ends on its own > a move out first cancels it: no late step, no timer leftUnit, Browserpasspasspasspass
after: a state that ends on its own > a state with no `after` costs no timerUnit, Browserpasspasspasspass
after: a state that ends on its own > a step to itself is a new visit tooUnit, Browserpasspasspasspass
after: a state that ends on its own > a time made from the state’s value: the retry waits longer each attemptUnit, Browserpasspasspasspass
after: a state that ends on its own > a timed step that fails (its data throws) is reported; the machine stays where it isUnit, Browserpasspasspasspass
after: a state that ends on its own > an initial state with a timeout starts its time when the machine is madeUnit, Browserpasspasspasspass
after: a state that ends on its own > an observer that moves the machine during the timed step leaves no stray timerUnit, Browserpasspasspasspass
after: a state that ends on its own > coming back starts the time again (the old visit’s time never fires)Unit, Browserpasspasspasspass
after: a state that ends on its own > still in the state when its time is up: the machine takes the step, with its dataUnit, Browserpasspasspasspass
after: a state that ends on its own > stop() cancels itUnit, Browserpasspasspasspass
after: a state that ends on its own > the timed step is a move like any other: tasks end, cleanups run, waits and observers hear itUnit, Browserpasspasspasspass
after: refused definitions > a state that is not a stateUnit, Browserpasspasspasspass
after: refused definitions > a target that is not one of the state’s stepsUnit, Browserpasspasspasspass
after: refused definitions > a time made from the state that is not a time: reported, and the state does not end at onceUnit, Browserpasspasspasspass
after: refused definitions > a time that is not a time, or longer than a timer can hold (2^31 - 1 ms, ~24.8 days)Unit, Browserpasspasspasspass
after: refused definitions > the longest time a timer holds is acceptedUnit, Browserpasspasspasspass
packages/machine/test/cache.test.ts
cache: ages > a set may say its own keep, in place of the cache’s, which is then not askedUnit, Browserpasspasspasspass
cache: ages > ages are swept at most once a second: a value due soon after a sweep goes with the next (reads are exact)Unit, Browserpasspasspasspass
cache: ages > keep is how long a value stays; one past its age is gone, noticed as ageUnit, Browserpasspasspasspass
cache: ages > keep made from the value and key; 0 keeps nothingUnit, Browserpasspasspasspass
cache: ages > one timer for all the ages, owned by the cacheUnit, Browserpasspasspasspass
cache: ages > the expired go before any live value goes for sizeUnit, Browserpasspasspasspass
cache: bounded > a keep that is no time is refused: a negative one, or one that is not a number or functionUnit, Browserpasspasspasspass
cache: bounded > a peek is not a useUnit, Browserpasspasspasspass
cache: bounded > a pinned value counts against max but does not go for size: the next oldest goesUnit, Browserpasspasspasspass
cache: bounded > a set that must make room replaces the key’s own value past its age: noticed as a replace, never as its ageUnit, Browserpasspasspasspass
cache: bounded > a set that only pinned values could make room for is not kept: it says false, nothing goes, and the old one staysUnit, Browserpasspasspasspass
cache: bounded > a value heavier than max, or with a bad weight, is not kept, and the old one staysUnit, Browserpasspasspasspass
cache: bounded > flights keeps at most 1000 answers by default, the least recently used out firstUnit, Browserpasspasspasspass
cache: bounded > max is required: there is no unbounded defaultUnit, Browserpasspasspasspass
cache: bounded > no options at all is refused with a code, never a TypeError reading themUnit, Browserpasspasspasspass
cache: bounded > past max, the least recently used goes first, and a get is a useUnit, Browserpasspasspasspass
cache: bounded > the least recently used order holds through repeated uses, replaces and lets go of the newestUnit, Browserpasspasspasspass
cache: bounded > the newest value read after it left finds nothing, whichever way it leftUnit, Browserpasspasspasspass
cache: bounded > weigh counts against max: as many go as it takes, oldest firstUnit, Browserpasspasspasspass
cache: freshness > a stamp with no world is refused as a bad optionUnit, Browserpasspasspasspass
cache: freshness > a write with no stamp takes the world nowUnit, Browserpasspasspasspass
cache: freshness > an older write never overwrites a newer oneUnit, Browserpasspasspasspass
cache: owned > an ended owner gives an ended cacheUnit, Browserpasspasspasspass
cache: owned > its owner ending ends it: every value noticed as end, oldest first, and nothing kept afterUnit, Browserpasspasspasspass
cache: owned > with no owner it ends when disposed (a scope can adopt it)Unit, Browserpasspasspasspass
cache: the eviction notice > a delete and a replace are noticed as delete; a clear notices each, oldest firstUnit, Browserpasspasspasspass
cache: the eviction notice > a flights answer that lands while the one it replaces is past its age is keptUnit, Browserpasspasspasspass
cache: the eviction notice > a notice that throws is reported with its code; the cache goes onUnit, Browserpasspasspasspass
cache: the eviction notice > a set or delete inside a notice is defined: its own notices come after the ones already dueUnit, Browserpasspasspasspass
cache: the eviction notice > a value replaced after its age, before its timer ran, is noticed as delete, not ageUnit, Browserpasspasspasspass
cache: the eviction notice > the value a key holds, set again, stays: no notice, its age starting overUnit, Browserpasspasspasspass
packages/machine/test/capability.test.ts
capability: deterministic tokens > a nonce-less token never checks where nonces are on, nor the other wayUnit, Browserpasspasspasspass
capability: deterministic tokens > mintUntil names the expiry itself, so two mints at different moments of one window matchUnit, Browserpasspasspasspass
capability: deterministic tokens > nonce off with replay on is refused: such tokens are not single-useUnit, Browserpasspasspasspass
capability: deterministic tokens > with nonce off, the same audience, fields and expiry mint the same token, which checks as often as presentedUnit, Browserpasspasspasspass
capability: lifetime > a mint is clamped to [min, max]; a token claiming more than max is refusedUnit, Browserpasspasspasspass
capability: lifetime > a NaN clock mints nothing and checks nothing; a NaN ttl mints nothingUnit, Browserpasspasspasspass
capability: options > refuses a missing audience, name, version or bounds with a coded errorUnit, Browserpasspasspasspass
capability: options > refuses a signer whose signature is not URL-safeUnit, Browserpasspasspasspass
capability: options > takes the highest version and a ttl.min equal to ttl.max; refuses a NaN ttl.minUnit, Browserpasspasspasspass
capability: replay > a full memory refuses a new token, never forgets a live one; an expired one makes roomUnit, Browserpasspasspasspass
capability: replay > with replay, a nonce checks once; without, as often as presentedUnit, Browserpasspasspasspass
capability: the keys a check trusts > a check may bring its own verify (a list of keys in rotation): it replaces the signer’sUnit, Browserpasspasspasspass
capability: two machines’ clocks > a remembered nonce stays until its token could no longer check, skew includedUnit, Browserpasspasspasspass
capability: two machines’ clocks > with skew, a token lives skew past its expiry and may claim skew past max, no moreUnit, Browserpasspasspasspass
capability: what checks > a token checks for its audience and fields, until it expiresUnit, Browserpasspasspasspass
capability: what checks > another audience, field, name, version or key is refusedUnit, Browserpasspasspasspass
capability: what checks > any changed character of a token is refusedUnit, Browserpasspasspasspass
capability: what checks > fields cannot trade text across a boundaryUnit, Browserpasspasspasspass
packages/machine/test/clock.test.ts
a queue reads deadlines on the monotonic clock > with no `now` of its own, a waiting job is past its deadline once clock.mono() says so (#1014)#1014Unit, Browserpasspasspasspass
a retry deadline is counted from the run’s start > a wait that would end exactly at the deadline is out of time at onceUnit, Browserpasspasspasspass
a retry deadline is counted from the run’s start > not from the clock’s zero: a process up for days still retriesUnit, Browserpasspasspasspass
a wall-clock step moves no duration > a kept answer stays kept for its TTL, however the wall clock steps (seeded)Unit, Browserpasspasspasspass
a wall-clock step moves no duration > a retry policy keeps its deadline when the wall clock jumps forward mid-runUnit, Browserpasspasspasspass
clock > mono is the monotonic clock, wall the wall clockUnit, Browserpasspasspasspass
packages/machine/test/decisions-production.node.test.ts
decisions(): a production build > a rules build (OGYGIA_RULES=1) keeps the field checkUnitpassnot runnot runnot run
decisions(): a production build > does not check fields (the check folds out), and still refusesUnitpassnot runnot runnot run
packages/machine/test/decisions.test.ts
decisions(): decide > a refused input throws its code, naming the input and the reasonUnit, Browserpasspasspasspass
decisions(): decide > a table with no refuse decides every inputUnit, Browserpasspasspasspass
decisions(): decide > gives the plan decide makes for an inputUnit, Browserpasspasspasspass
decisions(): decide > in dev, a value outside its field list throws, naming the fieldUnit, Browserpasspasspasspass
decisions(): decide > in dev, an empty or repeated field list is refused where the table is madeUnit, Browserpasspasspasspass
decisions(): decide > keeps the definition as givenUnit, Browserpasspasspasspass
decisions(): decide > the field check runs before refuse and decide see the inputUnit, Browserpasspasspasspass
decisions(): types > infers the input from the field lists, and the plan from decideUnit, Browserpasspasspasspass
testing: check > a rule that returns something other than true breaksUnit, Browserpasspasspasspass
testing: check > a rule that throws breaks, with what it threwUnit, Browserpasspasspasspass
testing: check > returns how many rows it checked when every rule holdsUnit, Browserpasspasspasspass
testing: check > throws naming each broken rule with the first row that breaks itUnit, Browserpasspasspasspass
testing: count and rows > a sample is that many distinct rows, the same for the same seed (property)Unit, Browserpasspasspasspass
testing: count and rows > a table with no fields has one row, the empty inputUnit, Browserpasspasspasspass
testing: count and rows > another seed picks other rowsUnit, Browserpasspasspasspass
testing: count and rows > count is the product of the list lengthsUnit, Browserpasspasspasspass
testing: count and rows > every row is a combination of the lists, each once, as many as count (property)Unit, Browserpasspasspasspass
testing: count and rows > rows is lazy: it decides one row per stepUnit, Browserpasspasspasspass
testing: count and rows > rows walks every combination in order, the last field fastest, refused ones namedUnit, Browserpasspasspasspass
testing: dead_fields > a field that only changes the refusal is not deadUnit, Browserpasspasspasspass
testing: dead_fields > equal plans that are new objects count as the sameUnit, Browserpasspasspasspass
testing: dead_fields > names the fields that never change the outcomeUnit, Browserpasspasspasspass
testing: dead_fields > the fields decide reads, with more than one value, are exactly the live ones (property)Unit, Browserpasspasspasspass
testing: table > a plan that is not an object is one plan column; pipes and line breaks are escapedUnit, Browserpasspasspasspass
testing: table > one row per input, fields as columns, the plan flattened, refused lastUnit, Browserpasspasspasspass
testing: the huge-space guard > a higher max walks it; a sample walks a seeded fewUnit, Browserpasspasspasspass
testing: the huge-space guard > refuses a sample that is not whole numbers, and a max under 1Unit, Browserpasspasspasspass
testing: the huge-space guard > refuses past 100,000 rows at once, naming the count and how to sampleUnit, Browserpasspasspasspass
testing: the huge-space guard > samples a space past the largest exact index (2^53) all the same: distinct rowsUnit, Browserpasspasspasspass
packages/machine/test/flights.test.ts
fresh > a fresh flight ends the one already out: its callers get STALEUnit, Browserpasspasspasspass
fresh > a fresh flight over one whose callers have signals: they get STALE, and their leaving later stops nothingUnit, Browserpasspasspasspass
fresh > a refresh that fails, or answers what is not kept, leaves the kept answer in placeUnit, Browserpasspasspasspass
fresh > starts a new flight beside the kept answer, which stays until the new one landsUnit, Browserpasspasspasspass
fresh > the last caller of a refresh leaving puts the kept answer backUnit, Browserpasspasspasspass
keep, max and weigh > `keep` made from the answer: 0 keeps nothing (callers share the flight while it is out)Unit, Browserpasspasspasspass
keep, max and weigh > `max` counts answers: past it the least recently used goes firstUnit, Browserpasspasspasspass
keep, max and weigh > `weigh` puts each answer against `max`; one heavier than all of `max` is not keptUnit, Browserpasspasspasspass
keep, max and weigh > a keep or weigh that throws fails the flight and keeps nothingUnit, Browserpasspasspasspass
keep, max and weigh > a refresh out keeps its prior against `max` until it lands; nothing kept passes `max` afterUnit, Browserpasspasspasspass
keep, max and weigh > a refresh that lands past its prior’s age, into a full cache no sweep has reached yet, is keptUnit, Browserpasspasspasspass
keep, max and weigh > a weight below 0 or not a number is not kept, so `max` still caps (#355)#355Unit, Browserpasspasspasspass
keep, max and weigh > an expired answer goes before a live one is pushed out (#356)#356Unit, Browserpasspasspasspass
keep, max and weigh > an expired answer is swept out when a new flight startsUnit, Browserpasspasspasspass
keep, max and weigh > keeps an answer for `keep` ms, real time, then runs againUnit, Browserpasspasspasspass
keyed > `key` names the fields that are one flight; the input that started it is the one that runsUnit, Browserpasspasspasspass
keyed > a caller that leaves gets STALE at once; the work stops only when the last one has leftUnit, Browserpasspasspasspass
keyed > a caller whose signal already aborted gets STALE and starts nothingUnit, Browserpasspasspasspass
keyed > a caller with no signal holds the flight: the others leaving does not stop itUnit, Browserpasspasspasspass
keyed > a drop ends the flight out: every caller gets STALE, its signal aborts, nothing is keptUnit, Browserpasspasspasspass
keyed > a drop predicate that gets or drops as it is asked: every key is asked once, every caller settlesUnit, Browserpasspasspasspass
keyed > a failure that lands after a drop is STALE, not a failure, for the callers of that flightUnit, Browserpasspasspasspass
keyed > a kept answer reaches a caller with a signal tooUnit, Browserpasspasspasspass
keyed > a key field compares objects by identity, and keeps every kind of value apartUnit, Browserpasspasspasspass
keyed > a keyed flights refuses a key it cannot use, where it is writtenUnit, Browserpasspasspasspass
keyed > a missing key field and one that is undefined are one key; a registered symbol is one by its nameUnit, Browserpasspasspasspass
keyed > a run that gets its own key before it returns joins its own flight (#354)#354Unit, Browserpasspasspasspass
keyed > drop by key fields, or by a predicate over them (never over the rest of the input)Unit, Browserpasspasspasspass
keyed > drop takes a predicate, over kept answers and flights out alikeUnit, Browserpasspasspasspass
keyed > one flight per key: the same key joins, another key runs on its ownUnit, Browserpasspasspasspass
keyed > runs inside the get that starts it, with a signal of its ownUnit, Browserpasspasspasspass
keyed > two inputs that differ in any key field never share an answerUnit, Browserpasspasspasspass
one key (what once() was) > a deadline aborts the try out and fails with a TimeoutErrorUnit, Browserpasspasspasspass
one key (what once() was) > a drop during the wait between tries ends them: STALE, no next tryUnit, Browserpasspasspasspass
one key (what once() was) > a run that throws synchronously is a failure tooUnit, Browserpasspasspasspass
one key (what once() was) > a weigh with no max is refused: the default max counts answers, not the weigh’s unitUnit, Browserpasspasspasspass
one key (what once() was) > callers while it runs share the one run, and the same promiseUnit, Browserpasspasspasspass
one key (what once() was) > every caller of a failed run gets the failure, then the next get starts freshUnit, Browserpasspasspasspass
one key (what once() was) > gives the last failure when its tries run outUnit, Browserpasspasspasspass
one key (what once() was) > its own handling of a failure adds no unhandled rejectionUnit, Browserpasspasspasspass
one key (what once() was) > never keeps a failure: the next get runs againUnit, Browserpasspasspasspass
one key (what once() was) > refuses options it cannot takeUnit, Browserpasspasspasspass
one key (what once() was) > runs on the first get and keeps the answerUnit, Browserpasspasspasspass
one key (what once() was) > takes a plain valueUnit, Browserpasspasspasspass
one key (what once() was) > tries again at once before it fails, within the turn: no timer between triesUnit, Browserpasspasspasspass
one key (what once() was) > waits between tries as its policy says, real timersUnit, Browserpasspasspasspass
owned > a disposed flights drops everything and runs nothing afterUnit, Browserpasspasspasspass
owned > a scope adopts it: closing the scope ends its flightsUnit, Browserpasspasspasspass
priority > a caller that leaves does not take the raise backUnit, Browserpasspasspasspass
priority > a fresh flight starts at its own caller priorityUnit, Browserpasspasspasspass
priority > a join with a higher priority raises the flight, and the run hears itUnit, Browserpasspasspasspass
priority > a join with a lower or equal priority never lowers it, and is not heardUnit, Browserpasspasspasspass
priority > a kept answer is given as it is: no run, nothing raisedUnit, Browserpasspasspasspass
priority > a priority that is not a number is refusedUnit, Browserpasspasspasspass
priority > a raise is heard only by the try that is out: a failed try’s listeners are let goUnit, Browserpasspasspasspass
priority > a raise listener that is not a function is refused with a code, when it is addedUnit, Browserpasspasspasspass
priority > a raise listener that throws is said, and the join and the other listeners go onUnit, Browserpasspasspasspass
priority > a run sees the priority of the get that started it (0 when it gave none)Unit, Browserpasspasspasspass
priority > every try a retry policy gives reads the priority as it standsUnit, Browserpasspasspasspass
priority > keyed: two inputs of one key are one flight, raised by the laterUnit, Browserpasspasspasspass
under load (real concurrency) > random gets, leaves, drops and answers: one run per flight, every caller settles, nothing failed is keptUnit, Browserpasspasspasspass
packages/machine/test/graph.test.ts
graph() > every state, its steps, whether it is final, and its own timeoutUnit, Browserpasspasspasspass
graph() > is plain data: it survives JSON (devtools send it over the wire)Unit, Browserpasspasspasspass
paths() > between them they take every step of the definitionUnit, Browserpasspasspasspass
paths() > every path can be driven: each move along it is allowedUnit, Browserpasspasspasspass
paths() > one path per step, each the shortest that reaches its state and takes itUnit, Browserpasspasspasspass
packages/machine/test/lock.test.ts
lock > a free lock refuses any freeUnit, Browserpasspasspasspass
lock > acquire: a waiter handed the lock lets go of its abort listener (a long-lived signal does not pile them up)Unit, Browserpasspasspasspass
lock > acquire: an abort after its turn changes nothingUnit, Browserpasspasspasspass
lock > acquire: an abort before its turn leaves the queue and rejects with the reasonUnit, Browserpasspasspasspass
lock > acquire: an already aborted signal rejects at once and never takes itUnit, Browserpasspasspasspass
lock > acquire: at once when freeUnit, Browserpasspasspasspass
lock > acquire: waits its turn, first come first served, handed straight onUnit, Browserpasspasspasspass
lock > every take gets a new tokenUnit, Browserpasspasspasspass
lock > freeing twice does nothing the second timeUnit, Browserpasspasspasspass
lock > only the token that holds it frees itUnit, Browserpasspasspasspass
lock > random runs agree with a model: one owner, exact held, first come first servedUnit, Browserpasspasspasspass
lock > seize: takes it from a stuck owner, whose late free is then refusedUnit, Browserpasspasspasspass
lock > take: one owner at a timeUnit, Browserpasspasspasspass
packages/machine/test/machine.test.ts
definition > a one-state machine works (initial, final)Unit, Browserpasspasspasspass
definition > copies the steps: changing the object it was given changes nothingUnit, Browserpasspasspasspass
definition > keeps its name, initial and steps, frozenUnit, Browserpasspasspasspass
definition > names its error: a MachineError with the code and its pageUnit, Browserpasspasspasspass
definition > refuses a state that can never be reachedUnit, Browserpasspasspasspass
definition > refuses a step listed twiceUnit, Browserpasspasspasspass
definition > refuses a step to a state that is not a stateUnit, Browserpasspasspasspass
definition > refuses an initial state that is not a stateUnit, Browserpasspasspasspass
definition > starts in an initial state that carries dataUnit, Browserpasspasspasspass
definition > treats state names like Object.prototype keys as plain namesUnit, Browserpasspasspasspass
go > a final state goes nowhereUnit, Browserpasspasspasspass
go > a state can step to itself (a fresh visit)Unit, Browserpasspasspasspass
go > moves along a step and says soUnit, Browserpasspasspasspass
go > throws in dev for a move the steps do not allow, and stays putUnit, Browserpasspasspasspass
machines are independent > machines of different definitions do not mixUnit, Browserpasspasspasspass
machines are independent > the STALE symbol is the same across copies of the packageUnit, Browserpasspasspasspass
machines are independent > two machines of one definition share nothingUnit, Browserpasspasspasspass
move > moves when the machine is still in fromUnit, Browserpasspasspasspass
move > refuses quietly when something else moved it firstUnit, Browserpasspasspasspass
move > throws in dev for a step that does not exist, even when not in fromUnit, Browserpasspasspasspass
now > a dataless state entered with {} is still that stateUnit, Browserpasspasspasspass
now > a dataless step to itself is a new visit tooUnit, Browserpasspasspasspass
now > carries the data of the state it is in, frozen in devUnit, Browserpasspasspasspass
now > copies the data: changing the object passed in changes nothingUnit, Browserpasspasspasspass
now > is a new value on every visit, with no data too: a saved now tells the visits apartUnit, Browserpasspasspasspass
now > is the same value for as long as the visit lastsUnit, Browserpasspasspasspass
now > refuses data with its own kindUnit, Browserpasspasspasspass
now > starts in initial, a value of its own, frozen in devUnit, Browserpasspasspasspass
observe > an observer that moves the machine again sees both moves in orderUnit, Browserpasspasspasspass
observe > an observer that throws does not break the move or the other observersUnit, Browserpasspasspasspass
observe > an observer that unsubscribes itself mid-move does not skip the next oneUnit, Browserpasspasspasspass
observe > hears every move and the stop, with the machineUnit, Browserpasspasspasspass
observe > hears nothing for a refused moveUnit, Browserpasspasspasspass
observe > stops hearing once it unsubscribesUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > a cleanup that moves the machine again works, and the next visit starts cleanUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > a refused move runs no cleanupUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > belongs to the visit it was added inUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > one that throws does not stop the others or the move; the move throws afterUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > runs at once on a stopped machineUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > runs once when the machine leaves, newest firstUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > sees the new state already in placeUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > several that throw come back togetherUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > the signal aborts before the cleanups runUnit, Browserpasspasspasspass
scope.task: work of one visit > a move with no task makes no abort controllerUnit, Browserpasspasspasspass
scope.task: work of one visit > a stopped machine does not run workUnit, Browserpasspasspasspass
scope.task: work of one visit > drops an answer that lands after the machine leftUnit, Browserpasspasspasspass
scope.task: work of one visit > drops it even when the machine came back to the same state (a new visit)Unit, Browserpasspasspasspass
scope.task: work of one visit > drops it on a step to itself tooUnit, Browserpasspasspasspass
scope.task: work of one visit > gives the answer while the machine stays putUnit, Browserpasspasspasspass
scope.task: work of one visit > passes a live signal, aborted once the machine leavesUnit, Browserpasspasspasspass
scope.task: work of one visit > rejects with the failure while the machine stays putUnit, Browserpasspasspasspass
scope.task: work of one visit > settles with STALE the moment the machine leaves, even when work never finishesUnit, Browserpasspasspasspass
scope.task: work of one visit > takes a plain value tooUnit, Browserpasspasspasspass
scope.task: work of one visit > tasks of one visit share one signal; the next visit gets a new oneUnit, Browserpasspasspasspass
scope.task: work of one visit > turns a failure after the machine left into STALE (no unhandled error)Unit, Browserpasspasspasspass
scope.task: work of one visit > turns a synchronous throw into a rejectionUnit, Browserpasspasspasspass
scope.task: work of one visit > work that ignores its signal and answers late still gives STALE onceUnit, Browserpasspasspasspass
scope.task: work of one visit > work that moves the machine itself gives STALEUnit, Browserpasspasspasspass
stop > a cleanup that throws on stop still runs the rest, then throwsUnit, Browserpasspasspasspass
stop > aborts tasks, runs cleanups, settles waits, refuses moves quietlyUnit, Browserpasspasspasspass
stop > twice is the same as onceUnit, Browserpasspasspasspass
wait > gives STALE as soon as the state cannot be reached any moreUnit, Browserpasspasspasspass
wait > gives STALE at once when the state is out of reach alreadyUnit, Browserpasspasspasspass
wait > many waits on many states settle each in turnUnit, Browserpasspasspasspass
wait > once every wait settled, the machine holds no wait list (a long-lived machine does not pile them up)Unit, Browserpasspasspasspass
wait > settles at once when the machine is in the stateUnit, Browserpasspasspasspass
wait > settles with the state it entered, even if the machine moved on sinceUnit, Browserpasspasspasspass
wait > settles with the state when the machine gets thereUnit, Browserpasspasspasspass
wait > stop settles every wait with STALEUnit, Browserpasspasspasspass
wait > throws in dev for a state that does not existUnit, Browserpasspasspasspass
packages/machine/test/mailbox-turns.test.ts
mailbox turns > a handler back in its turn from one wait takes its other wait’s return at once, not behind itselfUnit, Browserpasspasspasspass
mailbox turns > a handler that ended while its return was queued takes no turn: the next event still runsUnit, Browserpasspasspasspass
mailbox turns > an asker hears a handler that rejects after its turn began, and the box goes onUnit, Browserpasspasspasspass
mailbox turns > an event still queued when the owner closes never runs, though the turn ahead of it ends afterUnit, Browserpasspasspasspass
packages/machine/test/mailbox.node.test.ts
a mailbox in a Node process > a posted handler that rejects later is an unhandled rejection, as a direct call’s would beUnitpassnot runnot runnot run
a mailbox in a Node process > a posted handler that rejects later still ends its turn: the next one runsUnitpassnot runnot runnot run
packages/machine/test/mailbox.test.ts
mailbox > a closed box holds nothing: no queue, no waitsUnit, Browserpasspasspasspass
mailbox > a handler back from its wait holds the turn again: an event it posts runs after itUnit, Browserpasspasspasspass
mailbox > a handler handed the turn back from the queue holds it: an event it posts runs after itUnit, Browserpasspasspasspass
mailbox > a handler that ended while its wait sat in the queue takes no turn: the box goes onUnit, Browserpasspasspasspass
mailbox > a handler that never settles holds the box until its owner closesUnit, Browserpasspasspasspass
mailbox > a handler waiting on two things at once lets one event in, not two at once (#341)#341Unit, Browserpasspasspasspass
mailbox > a queued ask that has run leaves the wait list, so a long-lived box does not grow (#564)#564Unit, Browserpasspasspasspass
mailbox > a timer of a handler that waits after its turn ended takes nobody’s turn (#341)#341Unit, Browserpasspasspasspass
mailbox > a wait from a handler whose turn already ended ends nobody’s turn (#341)#341Unit, Browserpasspasspasspass
mailbox > a wait from outside any turn ends nobody’s turn (#341)#341Unit, Browserpasspasspasspass
mailbox > a wait whose work settled while another handler held the turn hears STALE when the box closesUnit, Browserpasspasspasspass
mailbox > an ask whose handler waits, then sees its element leave: STALE for the asker tooUnit, Browserpasspasspasspass
mailbox > an asker whose handler throws after waiting its turn hears the failure, never waits for goodUnit, Browserpasspasspasspass
mailbox > ask() gives the handler’s value, sync or async, in its turnUnit, Browserpasspasspasspass
mailbox > ends with its owner: queued events are dropped, a wait is STALE at once, later posts tooUnit, Browserpasspasspasspass
mailbox > gives a handler coming back from its wait no turn while another holds oneUnit, Browserpasspasspasspass
mailbox > holds the turn across a plain await: nothing else runs until the handler is backUnit, Browserpasspasspasspass
mailbox > is closed for an owner already closedUnit, Browserpasspasspasspass
mailbox > lets the next event in while a handler waits, and gives it its turn back behind itUnit, Browserpasspasspasspass
mailbox > reports a queued handler that throws, and goes on with the nextUnit, Browserpasspasspasspass
mailbox > runs a long run of sync events queued in one turn, on a flat stack (#342)#342Unit, Browserpasspasspasspass
mailbox > runs an event posted during a turn after it, never inside itUnit, Browserpasspasspasspass
mailbox > runs an event posted to an idle box at once, on the caller’s stackUnit, Browserpasspasspasspass
mailbox > runs events in the order they were posted, across waitsUnit, Browserpasspasspasspass
mailbox > tells an asker whose event was dropped STALEUnit, Browserpasspasspasspass
mailbox > throws a handler’s failure to its asker, and a wait’s rejection back in the turnUnit, Browserpasspasspasspass
mailbox > throws a sync failure to its poster when it runs at onceUnit, Browserpasspasspasspass
mailbox > with no page error handler, a queued handler’s throw follows its codeUnit, Browserpasspasspasspass
mailbox > work that settles after the box closed changes nothing: the box stays closed and idleUnit, Browserpasspasspasspass
packages/machine/test/module-collections.test.ts
observers are kept until each stops, and hear moves in the order they started watchingUnit, Browserpasspasspasspass
the once-per-warning memory is bounded: past its size, the oldest warning can be said againUnit, Browserpasspasspasspass
packages/machine/test/outbox-defaults.test.ts
outbox defaults > with no retry, a failed send is tried again by the standard policyUnit, Browserpasspasspasspass
packages/machine/test/outbox.test.ts
id > a put of an id still out joins it: one sendUnit, Browserpasspasspasspass
id > a receiver that failed to apply is tried again until it appliesUnit, Browserpasspasspasspass
id > done means applied: an answer lost after the apply is sent again, and the receiver drops the copyUnit, Browserpasspasspasspass
inOrder > a put of an id still queued joins it: one send, in its place in lineUnit, Browserpasspasspasspass
inOrder > one given up does not stop the ones after itUnit, Browserpasspasspasspass
inOrder > one send at a time, in put order, a failing one tried again before the next goesUnit, Browserpasspasspasspass
inOrder > sends go out together without itUnit, Browserpasspasspasspass
inOrder > the deadline counts from its own turn, not from the putUnit, Browserpasspasspasspass
inOrder > with none ahead, the send starts inside the put; behind one, once it endsUnit, Browserpasspasspasspass
policy > a list backs off by its entries (the last repeats); a number doublesUnit, Browserpasspasspasspass
policy > a run that answered leaves no timer behind, not even its deadline’sUnit, Browserpasspasspasspass
policy > a wait is always a number of 0 to the timer limit: before the first try, and after very many (#359)#359Unit, Browserpasspasspasspass
policy > fills what it leaves out from the standard one, and is frozenUnit, Browserpasspasspasspass
policy > jitter cuts a wait by up to its shareUnit, Browserpasspasspasspass
policy > out of time before the next wait ends is a TimeoutError with the last error in it (#359)#359Unit, Browserpasspasspasspass
policy > refuses numbers it cannot use, where they are writtenUnit, Browserpasspasspasspass
policy > takes the longest wait a timer can hold, and no longerUnit, Browserpasspasspasspass
policy > the caller leaving and the deadline in the same turn: whichever came first says how it endedUnit, Browserpasspasspasspass
policy > the outbox refuses a send that is not a functionUnit, Browserpasspasspasspass
put > a giveUp that throws is printed with the codeUnit, Browserpasspasspasspass
put > a send that throws before it returns is a failed try like any otherUnit, Browserpasspasspasspass
put > an id that is not a string or a finite number names nothing: not sent, said, false (#350)#350Unit, Browserpasspasspasspass
put > an id that throws: not sent, said, and put still never throwsUnit, Browserpasspasspasspass
put > gives up at once when the next wait would end past the deadlineUnit, Browserpasspasspasspass
put > ids 1 and "1" are two sendsUnit, Browserpasspasspasspass
put > out of tries: giveUp hears the last error once, and the put resolves falseUnit, Browserpasspasspasspass
put > returns at once, never throws, and resolves true once the send is doneUnit, Browserpasspasspasspass
put > the deadline aborts the try still out, and no try starts after itUnit, Browserpasspasspasspass
put > tries a failed send again after its backoff, until one is doneUnit, Browserpasspasspasspass
put > with no giveUp, a send given up is printed once with its codeUnit, Browserpasspasspasspass
waitUntil > a platform that refuses it does not stop the send, and put does not throwUnit, Browserpasspasspasspass
waitUntil > is handed each send, which settles when the send endsUnit, Browserpasspasspasspass
waitUntil > puts that join one send each hand it over, and each settles when that one send endsUnit, Browserpasspasspasspass
packages/machine/test/policy-run.test.ts
a caller whose signal already aborted gets STALE, and the work never runsUnit, Browserpasspasspasspass
packages/machine/test/process.node.test.ts
a Node process > collects a flights nobody holds, and its world forgets it (#352)#352Unitpassnot runnot runnot run
a Node process > frees a symbol a keyed flights spelled into a key, once nothing holds it (#357)#357Unitpassnot runnot runnot run
a Node process > loads any module of the package first: no import cycle runs a module before its classesUnitpassnot runnot runnot run
a Node process > stays alive through the wait between two tries of a send (#351)#351Unitpassnot runnot runnot run
packages/machine/test/production.test.ts
production > a saved now still tells two visits to one dataless state apartUnit, Browserpasspasspasspass
production > a step to a state that does not exist is skipped by wait() and paths() too, not a throw (#358)#358Unit, Browserpasspasspasspass
production > does not freeze data values (a production build skips the dev-only copy checks)Unit, Browserpasspasspasspass
production > prints again for a different wrong moveUnit, Browserpasspasspasspass
production > refuses a wrong move: false, stays put, prints the link onceUnit, Browserpasspasspasspass
production > skips the definition checks but still refuses an initial that is not a stateUnit, Browserpasspasspasspass
production > wait for a state that does not exist is STALE, not a throwUnit, Browserpasspasspasspass
production: a cache with no bound > a flights with no bound is thrown where it is written, even in productionUnit, Browserpasspasspasspass
production: a cache with no bound > is refused, not thrown: it keeps nothing, and the code is printedUnit, Browserpasspasspasspass
production: a slot asked for at another version > keeps one private value for that version, made once, and says it onceUnit, Browserpasspasspasspass
packages/machine/test/queue-passes.test.ts
budget > a drain starts jobs for ms, then yields, and goes on when resumedUnit, Browserpasspasspasspass
budget > a drain whose last start runs past its budget ends there, with no yield for nothingUnit, Browserpasspasspasspass
budget > a yield that throws is reported, and the drain goes on without itUnit, Browserpasspasspasspass
budget > defer: a drain begins with a yield, and one yield starts every job queued before itUnit, Browserpasspasspasspass
budget > settle: a start’s promise holder takes its first step before the next job is chosenUnit, Browserpasspasspasspass
budget > settle: jobs pushed in a drain’s last microtask take one more pass, not a pass eachUnit, Browserpasspasspasspass
budget > the first start goes out at once, without a yield before itUnit, Browserpasspasspasspass
options > a bad window max, too many windows or a bad budget is refused with machine_bad_optionUnit, Browserpasspasspasspass
passes > a job past its deadline is stale and never starts, ready or notUnit, Browserpasspasspasspass
passes > a job pushed while a pass runs goes after the pass’s jobs, in the order pushedUnit, Browserpasspasspasspass
passes > a rule that throws ends the drain and throws to the caller; the next wake drains againUnit, Browserpasspasspasspass
passes > a rule that throws in a drain its yield resumed at once throws to the caller, not as the yield’s failureUnit, Browserpasspasspasspass
passes > a start that throws is reported, its place and windows go back, and the pass goes onUnit, Browserpasspasspasspass
passes > a window alone counts places: holding is the started jobs not yet releasedUnit, Browserpasspasspasspass
passes > cancel takes a waiting job out, stale; the owner closing mid-yield starts nothing moreUnit, Browserpasspasspasspass
passes > no max and no window: every job starts, and none holds a place (its release does nothing)Unit, Browserpasspasspasspass
priority > a priority raised mid-drain, while it yields, counts at the pass after the yieldUnit, Browserpasspasspasspass
priority > ranks far apart or not whole still go highest first, ties in the order pushedUnit, Browserpasspasspasspass
priority > recheck() reads a raise at once when the queue is idleUnit, Browserpasspasspasspass
priority > the higher starts first, and ties keep the order pushedUnit, Browserpasspasspasspass
ready > a job that is not ready is passed over, and the jobs behind it startUnit, Browserpasspasspasspass
ready > a not-ready job does not hold its place in the cap: the next ready one takes itUnit, Browserpasspasspasspass
seeded runs (DST) > priorities raised while drains yield: every start is the best job that may start, within every capUnit, Browserpasspasspasspass
seeded runs (DST) > raises and releases inside settled starts: caps hold and every job startsUnit, Browserpasspasspasspass
windows > a job in two windows counts in both until its place is released, onceUnit, Browserpasspasspasspass
windows > a window caps the jobs it holds; the others start beside themUnit, Browserpasspasspasspass
windows > a window freed mid-yield lets the next job in at the pass after the yieldUnit, Browserpasspasspasspass
windows > the window is read as the job starts: a job that left it while waiting is not cappedUnit, Browserpasspasspasspass
packages/machine/test/queue.test.ts
a stale hook that pushes or releases > mid-expiry: every expired job is stale once, none skipped, after the list is compacted under itUnit, Browserpasspasspasspass
a stale hook that pushes or releases > when the owner closes: every waiting job is stale onceUnit, Browserpasspasspasspass
cancel > a waiting job leaves at once and is stale; a started one is untouchedUnit, Browserpasspasspasspass
deadline > a deadline pushed after the timer went (cancelled or expired) arms a new oneUnit, Browserpasspasspasspass
deadline > a job still waiting at its deadline is stale and never startsUnit, Browserpasspasspasspass
deadline > a job with a deadline still goes stale on time after another waiting job is cancelledUnit, Browserpasspasspasspass
deadline > after the list compacts, a job past its deadline is still passed overUnit, Browserpasspasspasspass
deadline > many deadlines share one timer, each settles at its own time, and none is leftUnit, Browserpasspasspasspass
deadline > one whose deadline came is passed over at a release, even before its timer ranUnit, Browserpasspasspasspass
deadline > the timer goes once no job with a deadline waitsUnit, Browserpasspasspasspass
max > a place is its job’s, given back once: a second release frees no other job’s placeUnit, Browserpasspasspasspass
max > a start that pushes or releases inside the drain keeps the order and the capUnit, Browserpasspasspasspass
max > at most max start; a release hands its place to the next in the same stepUnit, Browserpasspasspasspass
max > first come, first servedUnit, Browserpasspasspasspass
options > a bad max is refused with machine_bad_optionUnit, Browserpasspasspasspass
stale > a stale hook that throws is reported, and the other waiting jobs still go stale and none hangsUnit, Browserpasspasspasspass
start > a start that throws gives its place back: the next job starts in itUnit, Browserpasspasspasspass
start > a start that throws is reported, and the jobs after it still startUnit, Browserpasspasspasspass
the queue's owner > closing it makes every waiting job stale, and a job pushed after is stale at onceUnit, Browserpasspasspasspass
packages/machine/test/random-port-secure.node.test.ts
no seeded generator ships > no package's source imports the simulator, whose seeded generator it isUnitpassnot runnot runnot run
no seeded generator ships > the ports' bytes and uuid read only the platform's cryptoUnitpassnot runnot runnot run
random.bytes and random.uuid are Web Crypto > a uuid is crypto.randomUUID, and Math.random is never readUnitpassnot runnot runnot run
random.bytes and random.uuid are Web Crypto > bytes are crypto.getRandomValues, and Math.random is never readUnitpassnot runnot runnot run
random.bytes and random.uuid are Web Crypto > with no Web Crypto at all, bytes and uuid throw rather than fall backUnitpassnot runnot runnot run
random.bytes and random.uuid are Web Crypto > without randomUUID (a page not on HTTPS), a uuid is made from crypto.getRandomValuesUnitpassnot runnot runnot run
packages/machine/test/random.test.ts
random runs agree with the model > 2000 seeds × 120 stepsUnit, Browserpasspasspasspass
packages/machine/test/registry.test.ts
definer calls: each module run owns what it defines > a module's next run ends its last one: a definition the new run does not make is goneUnit, Browserpasspasspasspass
definer calls: each module run owns what it defines > another module's run does not end this one'sUnit, Browserpasspasspasspass
definer calls: each module run owns what it defines > defining() is restored after a nested call and after a throwUnit, Browserpasspasspasspass
definer calls: each module run owns what it defines > inside a marked call, defining() is the run; outside, nullUnit, Browserpasspasspasspass
keyed registry: definitions by name, each owned by its defining module > a definition is found by its key; one set again under its key replaces the oldUnit, Browserpasspasspasspass
keyed registry: definitions by name, each owned by its defining module > an owner's end ends its definitions: one not set again is gone, one set again staysUnit, Browserpasspasspasspass
keyed registry: definitions by name, each owned by its defining module > another module cannot take a definition away by ending: only its own goUnit, Browserpasspasspasspass
keyed registry: definitions by name, each owned by its defining module > setting with an owner that already ended is refusedUnit, Browserpasspasspasspass
keyed registry: definitions by name, each owned by its defining module > the definitions walk in the order they were last set, liveUnit, Browserpasspasspasspass
registry: live entries, each owned > a snapshot is every entry in add order, not cut short by a removal while it is walkedUnit, Browserpasspasspasspass
registry: live entries, each owned > a snapshot is the same array until an entry is added or removedUnit, Browserpasspasspasspass
registry: live entries, each owned > adding with an owner that already ended is refused: nothing is addedUnit, Browserpasspasspasspass
registry: live entries, each owned > an entry removed while the registry is walked is not walked afterUnit, Browserpasspasspasspass
registry: live entries, each owned > an owner ending removes exactly its own entriesUnit, Browserpasspasspasspass
registry: live entries, each owned > iterates in add orderUnit, Browserpasspasspasspass
registry: live entries, each owned > nothing is ever evicted: as many entries as their owners keepUnit, Browserpasspasspasspass
registry: live entries, each owned > the removal takes its entry out, once, and leaves nothing behind in its ownerUnit, Browserpasspasspasspass
packages/machine/test/say.test.ts
say() > 10,000 distinct keys keep at most the boundUnit, Browserpasspasspasspass
say() > a bound that is not a whole number above 0 is refusedUnit, Browserpasspasspasspass
say() > a failure after a recovery is said again: once per failing streakUnit, Browserpasspasspasspass
say() > a key that comes again is kept over one said once long ago, when the bound lets one goUnit, Browserpasspasspasspass
say() > remembers 1024 keys by defaultUnit, Browserpasspasspasspass
say() > says a key once, however often it comesUnit, Browserpasspasspasspass
say() > says each key once: once per keyUnit, Browserpasspasspasspass
warn_once > 10,000 distinct warnings keep at most 1024: the oldest is said againUnit, Browserpasspasspasspass
packages/machine/test/scope.test.ts
a machine visit is a scope > a move that throws from its cleanups names the machineUnit, Browserpasspasspasspass
a machine visit is a scope > a stopped machine’s scope is closed: work does not run, cleanups run at onceUnit, Browserpasspasspasspass
a machine visit is a scope > a visit nothing hangs work on makes no scopeUnit, Browserpasspasspasspass
a machine visit is a scope > one scope per visit: the same through the visit, closed by leaving, a new one next timeUnit, Browserpasspasspasspass
a machine visit is a scope > what a visit holds is let go when the machine leaves: listeners, timers, observersUnit, Browserpasspasspasspass
children > a child can close sooner on its own, and the parent then lets go of itUnit, Browserpasspasspasspass
children > a cleanup that gives the closing scope more work gets the closed behaviourUnit, Browserpasspasspasspass
children > a closed scope’s child is closedUnit, Browserpasspasspasspass
children > a long-lived parent holds none of the children that closed on their ownUnit, Browserpasspasspasspass
children > close before the parent’s own cleanups, newest firstUnit, Browserpasspasspasspass
children > what a child throws is thrown by the parent’s close, after its own cleanups ranUnit, Browserpasspasspasspass
close > a cleanup given to a closed scope runs at onceUnit, Browserpasspasspasspass
close > a cleanup that throws does not stop the others; close throws it after all have runUnit, Browserpasspasspasspass
close > a release that throws does not stop the other releases or the cleanups (#346)#346Unit, Browserpasspasspasspass
close > is safe to call twice, and says it closedUnit, Browserpasspasspasspass
close > more than one throws: an AggregateError, newest firstUnit, Browserpasspasspasspass
close > runs cleanups once, newest firstUnit, Browserpasspasspasspass
close > works with `using`Unit, Browserpasspasspasspass
on > a capture listener given as an object is let go on close; so is a non-capture one with optionsUnit, Browserpasspasspasspass
on > a closed scope does not listen at allUnit, Browserpasspasspasspass
on > a once listener that fired lets go of itself: a long-lived scope does not pile them up (#348)#348Unit, Browserpasspasspasspass
on > a real window listener is gone after closeUnit, Browserskippasspasspass
on > keeps the listener options (capture, once) and lets go early when askedUnit, Browserpasspasspasspass
on > listens on a Node-style emitter (on / off)Unit, Browserpasspasspasspass
on > listens on an event target until the scope closesUnit, Browserpasspasspasspass
signal > a child’s signal aborts before its parent’sUnit, Browserpasspasspasspass
signal > a scope nothing asks a signal of makes no abort controllerUnit, Browserpasspasspasspass
signal > aborts on close, before the cleanups runUnit, Browserpasspasspasspass
signal > is one signal for the scope’s life; a closed scope’s is already abortedUnit, Browserpasspasspasspass
task > a closed scope does not run workUnit, Browserpasspasspasspass
task > a failure while open rejects; a throw at once tooUnit, Browserpasspasspasspass
task > an answer or a failure after the scope closed is STALEUnit, Browserpasspasspasspass
task > gives the answer while the scope is openUnit, Browserpasspasspasspass
task > settles with STALE the moment the scope closes, even when work never finishesUnit, Browserpasspasspasspass
task > work that closes its own scope before it returns still settles with STALE (#349)#349Unit, Browserpasspasspasspass
timers > 'frame' and 'idle' run once (a frame, idle time, or the next task where there is none)Unit, Browserpasspasspasspass
timers > 'frame' waits for the host's frame and 'idle' for its idle time; closing cancels eachUnit, Browserpasspasspasspass
timers > a closed scope sets no timerUnit, Browserpasspasspasspass
timers > a fired timeout lets go of itself: a long-lived scope does not pile them upUnit, Browserpasspasspasspass
timers > closing clears a timeout that has not run; its cancel does tooUnit, Browserpasspasspasspass
timers > every repeats until the scope closesUnit, Browserpasspasspasspass
timers > refuses a time a timer cannot holdUnit, Browserpasspasspasspass
timers > timeout runs once after its time, real timersUnit, Browserpasspasspasspass
watch and adopt > `await using` gets the errors of an async disposal; a plain close reports themUnit, Browserpasspasspasspass
watch and adopt > `await using` throws what a cleanup threwUnit, Browserpasspasspasspass
watch and adopt > `await using` whose cleanup throws still waits for the async disposals, then throws both togetherUnit, Browserpasspasspasspass
watch and adopt > a real MutationObserver stops hearing changes after closeUnit, Browserskippasspasspass
watch and adopt > a task whose work closes its own scope and then fails is STALE, its failure never unhandledUnit, Browserpasspasspasspass
watch and adopt > adopts what disposes itself, sync or asyncUnit, Browserpasspasspasspass
watch and adopt > an async disposal adopted by a cleanup of the close goes with the close: `await using` gets its errorUnit, Browserpasspasspasspass
watch and adopt > an async disposal adopted by a closed scope runs at once, is said when it fails, and is not kept (#347)#347Unit, Browserpasspasspasspass
watch and adopt > disconnects an observer on close (at once on a closed scope)Unit, Browserpasspasspasspass
watch and adopt > disposes at once on a closed scopeUnit, Browserpasspasspasspass
watch and adopt > refuses what cannot dispose itselfUnit, Browserpasspasspasspass
packages/machine/test/slot.test.ts
slot > a copy at another version is refused in dev: both versions namedUnit, Browserpasspasspasspass
slot > a name outside ogygia., one with a version suffix, or a bad version is refusedUnit, Browserpasspasspasspass
slot > makes the value once, and every later call (another copy) gets the same oneUnit, Browserpasspasspasspass
packages/machine/test/stage-commit-while-closing.test.ts
a commit asked for while the owner closes (from the build’s abort) is refused, and the build is given backUnit, Browserpasspasspasspass
packages/machine/test/stage.test.ts
a commit in progress > a commit that closes its owner and then throws still puts everything backUnit, Browserpasspasspasspass
a commit in progress > a commit that closes its owner keeps what it committed (#343)#343Unit, Browserpasspasspasspass
after the commit > a commit ends the stage in committedUnit, Browserpasspasspasspass
after the commit > a discard step given after a discard runs at onceUnit, Browserpasspasspasspass
after the commit > a discard step given after the commit is dropped, not run (#344)#344Unit, Browserpasspasspasspass
after the commit > a stage that committed or was discarded leaves nothing on its owner (#345)#345Unit, Browserpasspasspasspass
after the commit > an ended stage keeps none of its discard steps, not even one given lateUnit, Browserpasspasspasspass
after the commit > discard and undo steps run newest firstUnit, Browserpasspasspasspass
an owner that closes first > an owner already closed never buildsUnit, Browserpasspasspasspass
an owner that closes first > ready is STALE at once, and what the build made so far is given backUnit, Browserpasspasspasspass
an owner that closes first > the build’s signal aborts when the owner closesUnit, Browserpasspasspasspass
build and commit > a commit after the owner closed is refused, and the build is given backUnit, Browserpasspasspasspass
build and commit > a committed stage gives nothing back when its owner closesUnit, Browserpasspasspasspass
build and commit > builds off to the side, then switches in at onceUnit, Browserpasspasspasspass
failures > a build that throws gives back what it made, and ready rejectsUnit, Browserpasspasspasspass
failures > a commit that throws puts back what it changed, gives back the build, and throwsUnit, Browserpasspasspasspass
failures > a step that throws is said once, and the others still runUnit, Browserpasspasspasspass
failures > refuses a build or commit that is not a functionUnit, Browserpasspasspasspass
packages/machine/test/stale-waits.test.ts
a stale part makes the whole wait stale (#378) > a flights run: its callers get STALE, and nothing is kept (#377)#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a fresh flight that answers STALE gives the kept answer back#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a machine visit’s scope.task#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a mailbox turn’s wait, an outside wait and an ask#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a STALE answer of its own: the wait is STALE, and nothing is kept (#377)#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > scope.task#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > stage().ready#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > under_policy#378Unit, Browserpasspasspasspass
only one level deep, only arrays > an array with no STALE comes through as it isUnit, Browserpasspasspasspass
only one level deep, only arrays > objects and nested arrays are not scannedUnit, Browserpasspasspasspass
packages/machine/test/storage-port.test.ts
storage that throws as it is read is no storageUnit, Browserpasspasspasspass
packages/machine/test/testing-entry.node.test.ts
@ogygia/machine/testing: a test-only entry > is its own export, in the workspace and in the published packageUnitpassnot runnot runnot run
@ogygia/machine/testing: a test-only entry > the runtime entry never imports itUnitpassnot runnot runnot run
packages/machine/test/trace.test.ts
trace() > forgets its lines on clear(), and keeps numberingUnit, Browserpasspasspasspass
trace() > hears nothing after stop(), and keeps what it heardUnit, Browserpasspasspasspass
trace() > keeps the last `max` lines and says how many it let goUnit, Browserpasspasspasspass
trace() > records only the names `only` acceptsUnit, Browserpasspasspasspass
trace() > stops at the end of a `using` blockUnit, Browserpasspasspasspass
trace() > writes `stopped` when a machine stopsUnit, Browserpasspasspasspass
trace() > writes each move as `name#n from -> to`, numbering each machine per name as it first movesUnit, Browserpasspasspasspass
packages/machine/test/types.test.ts
types > a stale part makes the whole wait stale: past the check, no slot is Stale (#378)#378Unit, Browserpasspasspasspass
types > after: a timeout takes one of its state’s steps, with the data that state needsUnit, Browserpasspasspasspass
types > create takes the initial state data when it has someUnit, Browserpasspasspasspass
types > flights: one key takes no input, a keyed one its input, answers may be STALEUnit, Browserpasspasspasspass
types > go takes only states some step leads to, with their dataUnit, Browserpasspasspasspass
types > graph and paths name the statesUnit, Browserpasspasspasspass
types > lockUnit, Browserpasspasspasspass
types > move checks the step itselfUnit, Browserpasspasspasspass
types > now is a union that narrows on kindUnit, Browserpasspasspasspass
types > scope: listeners get the event their target namesUnit, Browserpasspasspasspass
types > task gives the answer or STALEUnit, Browserpasspasspasspass
types > the definition is checked as it is writtenUnit, Browserpasspasspasspass
types > wait gives that state or STALEUnit, Browserpasspasspasspass
packages/machine/test/world.test.ts
a world > a key moved again goes to the back of the line: past KEYS_KEPT, the oldest move folds, not its newestUnit, Browserpasspasspasspass
a world > a key moved again is the newest in line: the next fold takes an older keyUnit, Browserpasspasspasspass
a world > a keyed world moves only what read the keys it movedUnit, Browserpasspasspasspass
a world > a stamp from the future is never freshUnit, Browserpasspasspasspass
a world > a stamp is fresh until the world moves, and only moves forwardUnit, Browserpasspasspasspass
a world > a watcher hears each move, the keys it moved or null, until it stops watchingUnit, Browserpasspasspasspass
a world > a watcher let go hears no more moves, and its owner is no longer watched for collectionUnit, Browserpasspasspasspass
a world > a whole move is never undone by a later key folding into the floorUnit, Browserpasspasspasspass
a world > a whole move of a keyed world puts every stamp before it out of dateUnit, Browserpasspasspasspass
a world > an empty move moves nothingUnit, Browserpasspasspasspass
a world > one move of more than KEYS_KEPT keys folds into the floor: out of date for every key, never fresh by mistakeUnit, Browserpasspasspasspass
a world > past KEYS_KEPT keys, the oldest move folds into the floor: never fresh when it is notUnit, Browserpasspasspasspass
flights in a world > a disposed flights lets go of its world: the world holds no watcher for itUnit, Browserpasspasspasspass
flights in a world > a disposed flights stops hearing its worldUnit, Browserpasspasspasspass
flights in a world > a keyed move drops the kept answers made from its keys, and only thoseUnit, Browserpasspasspasspass
flights in a world > a move drops the kept answers and ends the flights out: their callers get STALEUnit, Browserpasspasspasspass
flights in a world > a move of other keys keeps the flight out and its answer (#294)#294Unit, Browserpasspasspasspass
flights in a world > a refresh beside a kept answer: an answer made stale on the way leaves the kept oneUnit, Browserpasspasspasspass
flights in a world > a touches that throws: the kept answer goes on a move, a landing fails its callersUnit, Browserpasspasspasspass
flights in a world > an answer whose world moved on its way is STALE for every joiner, and not keptUnit, Browserpasspasspasspass
flights in a world > takes only a world made by world()Unit, Browserpasspasspasspass
flights in a world > with no touches, a move of some keys still ends the flights out at onceUnit, Browserpasspasspasspass
flights in a world > with touches, a whole move drops every kept answer and ends the flights outUnit, Browserpasspasspasspass