x/evt/test/test105.ts
1234567891011121314151617181920212223242526272829import { Evt } from "../lib/index.ts";import { assert } from "https://deno.land/x/tsafe@v1.3.4/assert.ts";const log = console.log;{ const console = { "log": (str: string | number) => console.stdOut += `${str}`, "stdOut": "" }; const ctx = Evt.newCtx(); const evt = Evt.create("foo"); ctx.done(); evt.attach(ctx, str => console.log(str)); evt.post("bar"); evt.post("baz"); assert(console.stdOut === "foo"); log("PASS");}