@moq/net 0.2.7 → 0.3.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/connection/accept.js +8 -3
- package/connection/accept.js.map +1 -1
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +5 -2
- package/connection/connect.js.map +1 -1
- package/connection/handshake.d.ts +9 -1
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +18 -14
- package/connection/handshake.js.map +1 -1
- package/consume.d.ts +1 -1
- package/consume.js +1 -1
- package/consume.js.map +1 -1
- package/ietf/connection.d.ts +7 -1
- package/ietf/connection.d.ts.map +1 -1
- package/ietf/connection.js +23 -3
- package/ietf/connection.js.map +1 -1
- package/ietf/index.d.ts +1 -0
- package/ietf/index.d.ts.map +1 -1
- package/ietf/index.js +1 -0
- package/ietf/index.js.map +1 -1
- package/ietf/parameters.d.ts +1 -0
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +2 -0
- package/ietf/parameters.js.map +1 -1
- package/ietf/publisher.d.ts +22 -8
- package/ietf/publisher.d.ts.map +1 -1
- package/ietf/publisher.js +294 -77
- package/ietf/publisher.js.map +1 -1
- package/ietf/solicit.d.ts +41 -0
- package/ietf/solicit.d.ts.map +1 -0
- package/ietf/solicit.js +47 -0
- package/ietf/solicit.js.map +1 -0
- package/ietf/subscriber.d.ts +4 -0
- package/ietf/subscriber.d.ts.map +1 -1
- package/ietf/subscriber.js +122 -50
- package/ietf/subscriber.js.map +1 -1
- package/lite/publisher.d.ts.map +1 -1
- package/lite/publisher.js +43 -9
- package/lite/publisher.js.map +1 -1
- package/lite/subscriber.js +3 -3
- package/lite/subscriber.js.map +1 -1
- package/package.json +2 -2
- package/path.d.ts +19 -11
- package/path.d.ts.map +1 -1
- package/path.js +43 -15
- package/path.js.map +1 -1
- package/stream.d.ts +46 -2
- package/stream.d.ts.map +1 -1
- package/stream.js +71 -6
- package/stream.js.map +1 -1
- package/track.d.ts +20 -7
- package/track.d.ts.map +1 -1
- package/track.js +63 -27
- package/track.js.map +1 -1
- package/announced.test.d.ts +0 -2
- package/announced.test.d.ts.map +0 -1
- package/announced.test.js +0 -37
- package/announced.test.js.map +0 -1
- package/broadcast.test.d.ts +0 -2
- package/broadcast.test.d.ts.map +0 -1
- package/broadcast.test.js +0 -243
- package/broadcast.test.js.map +0 -1
- package/connection/browser.test.d.ts +0 -2
- package/connection/browser.test.d.ts.map +0 -1
- package/connection/browser.test.js +0 -29
- package/connection/browser.test.js.map +0 -1
- package/connection/cert.test.d.ts +0 -2
- package/connection/cert.test.d.ts.map +0 -1
- package/connection/cert.test.js +0 -26
- package/connection/cert.test.js.map +0 -1
- package/connection/connect.test.d.ts +0 -2
- package/connection/connect.test.d.ts.map +0 -1
- package/connection/connect.test.js +0 -118
- package/connection/connect.test.js.map +0 -1
- package/connection/reload.test.d.ts +0 -2
- package/connection/reload.test.d.ts.map +0 -1
- package/connection/reload.test.js +0 -160
- package/connection/reload.test.js.map +0 -1
- package/connection/stats.test.d.ts +0 -2
- package/connection/stats.test.d.ts.map +0 -1
- package/connection/stats.test.js +0 -120
- package/connection/stats.test.js.map +0 -1
- package/error.test.d.ts +0 -2
- package/error.test.d.ts.map +0 -1
- package/error.test.js +0 -89
- package/error.test.js.map +0 -1
- package/group.test.d.ts +0 -2
- package/group.test.d.ts.map +0 -1
- package/group.test.js +0 -152
- package/group.test.js.map +0 -1
- package/ietf/aliases.test.d.ts +0 -2
- package/ietf/aliases.test.d.ts.map +0 -1
- package/ietf/aliases.test.js +0 -30
- package/ietf/aliases.test.js.map +0 -1
- package/ietf/ietf.test.d.ts +0 -2
- package/ietf/ietf.test.d.ts.map +0 -1
- package/ietf/ietf.test.js +0 -983
- package/ietf/ietf.test.js.map +0 -1
- package/ietf/priority.test.d.ts +0 -2
- package/ietf/priority.test.d.ts.map +0 -1
- package/ietf/priority.test.js +0 -18
- package/ietf/priority.test.js.map +0 -1
- package/integration.test.d.ts +0 -2
- package/integration.test.d.ts.map +0 -1
- package/integration.test.js +0 -1006
- package/integration.test.js.map +0 -1
- package/lite/announce.test.d.ts +0 -2
- package/lite/announce.test.d.ts.map +0 -1
- package/lite/announce.test.js +0 -91
- package/lite/announce.test.js.map +0 -1
- package/lite/datagram.test.d.ts +0 -2
- package/lite/datagram.test.d.ts.map +0 -1
- package/lite/datagram.test.js +0 -26
- package/lite/datagram.test.js.map +0 -1
- package/lite/datagram_stream.test.d.ts +0 -2
- package/lite/datagram_stream.test.d.ts.map +0 -1
- package/lite/datagram_stream.test.js +0 -15
- package/lite/datagram_stream.test.js.map +0 -1
- package/lite/fetch.test.d.ts +0 -2
- package/lite/fetch.test.d.ts.map +0 -1
- package/lite/fetch.test.js +0 -41
- package/lite/fetch.test.js.map +0 -1
- package/lite/priority.test.d.ts +0 -2
- package/lite/priority.test.d.ts.map +0 -1
- package/lite/priority.test.js +0 -77
- package/lite/priority.test.js.map +0 -1
- package/lite/publisher.test.d.ts +0 -2
- package/lite/publisher.test.d.ts.map +0 -1
- package/lite/publisher.test.js +0 -334
- package/lite/publisher.test.js.map +0 -1
- package/lite/setup.test.d.ts +0 -2
- package/lite/setup.test.d.ts.map +0 -1
- package/lite/setup.test.js +0 -134
- package/lite/setup.test.js.map +0 -1
- package/lite/subscribe.test.d.ts +0 -2
- package/lite/subscribe.test.d.ts.map +0 -1
- package/lite/subscribe.test.js +0 -110
- package/lite/subscribe.test.js.map +0 -1
- package/lite/subscriber.test.d.ts +0 -2
- package/lite/subscriber.test.d.ts.map +0 -1
- package/lite/subscriber.test.js +0 -108
- package/lite/subscriber.test.js.map +0 -1
- package/lite/track.test.d.ts +0 -2
- package/lite/track.test.d.ts.map +0 -1
- package/lite/track.test.js +0 -55
- package/lite/track.test.js.map +0 -1
- package/path.test.d.ts +0 -2
- package/path.test.d.ts.map +0 -1
- package/path.test.js +0 -210
- package/path.test.js.map +0 -1
- package/stream.test.d.ts +0 -2
- package/stream.test.d.ts.map +0 -1
- package/stream.test.js +0 -252
- package/stream.test.js.map +0 -1
- package/time.test.d.ts +0 -2
- package/time.test.d.ts.map +0 -1
- package/time.test.js +0 -12
- package/time.test.js.map +0 -1
- package/track.test.d.ts +0 -2
- package/track.test.d.ts.map +0 -1
- package/track.test.js +0 -212
- package/track.test.js.map +0 -1
- package/util/timeout.test.d.ts +0 -2
- package/util/timeout.test.d.ts.map +0 -1
- package/util/timeout.test.js +0 -18
- package/util/timeout.test.js.map +0 -1
- package/varint.test.d.ts +0 -2
- package/varint.test.d.ts.map +0 -1
- package/varint.test.js +0 -106
- package/varint.test.js.map +0 -1
package/path.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.test.js","sourceRoot":"","sources":["../src/path.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,IAAI,CAAC,qDAAqD,EAAE,GAAG,EAAE;IAChE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAuB,CAAC,CAAC;IAC7D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,SAAuB,CAAC,CAAC;IACjE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAuB,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACjD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAgB,CAAC,CAAC;IAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAgB,CAAC,CAAC;IAC9C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KA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C,CAAC;IACnF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAqB,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAe,CAAC;IACjG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,QAAsB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AACvE,CAAC,CAAC,CAAC","sourcesContent":["import { expect, test } from \"bun:test\";\nimport * as Path from \"./path.ts\";\n\ntest(\"Path constructor trims leading and trailing slashes\", () => {\n\texpect(Path.from(\"/foo/bar/\")).toBe(\"foo/bar\" as Path.Valid);\n\texpect(Path.from(\"///foo/bar///\")).toBe(\"foo/bar\" as Path.Valid);\n\texpect(Path.from(\"foo/bar\")).toBe(\"foo/bar\" as Path.Valid);\n});\n\ntest(\"Path constructor handles empty paths\", () => {\n\texpect(Path.from(\"\")).toBe(\"\" as Path.Valid);\n\texpect(Path.from(\"/\")).toBe(\"\" as Path.Valid);\n\texpect(Path.from(\"///\")).toBe(\"\" as Path.Valid);\n});\n\ntest(\"hasPrefix matches exact paths\", () => {\n\tconst path = Path.from(\"foo/bar\");\n\texpect(Path.hasPrefix(Path.from(\"foo/bar\"), path)).toBe(true);\n});\n\ntest(\"hasPrefix matches proper prefixes\", () => {\n\tconst path = Path.from(\"foo/bar/baz\");\n\texpect(Path.hasPrefix(Path.from(\"foo\"), path)).toBe(true);\n\texpect(Path.hasPrefix(Path.from(\"foo/bar\"), path)).toBe(true);\n});\n\ntest(\"hasPrefix does not match partial segment prefixes\", () => {\n\tconst path = Path.from(\"foobar\");\n\texpect(Path.hasPrefix(Path.from(\"foo\"), path)).toBe(false);\n\n\tconst path2 = Path.from(\"foo/bar\");\n\texpect(Path.hasPrefix(Path.from(\"fo\"), path2)).toBe(false);\n});\n\ntest(\"hasPrefix handles empty prefix\", () => {\n\tconst path = Path.from(\"foo/bar\");\n\texpect(Path.hasPrefix(Path.empty(), path)).toBe(true);\n});\n\ntest(\"hasPrefix ignores trailing slashes in prefix\", () => {\n\tconst path = Path.from(\"foo/bar\");\n\texpect(Path.hasPrefix(Path.from(\"foo/\"), path)).toBe(true);\n\texpect(Path.hasPrefix(Path.from(\"foo/bar/\"), path)).toBe(true);\n});\n\ntest(\"stripPrefix strips valid prefixes\", () => {\n\tconst path = Path.from(\"foo/bar/baz\");\n\n\tconst suffix1 = Path.stripPrefix(Path.from(\"foo\"), path);\n\texpect(suffix1).toBe(\"bar/baz\" as Path.Valid);\n\n\tconst suffix2 = Path.stripPrefix(Path.from(\"foo/bar\"), path);\n\texpect(suffix2).toBe(\"baz\" as Path.Valid);\n\n\tconst suffix3 = Path.stripPrefix(Path.from(\"foo/bar/baz\"), path);\n\texpect(suffix3).toBe(\"\" as Path.Valid);\n});\n\ntest(\"stripPrefix returns null for invalid prefixes\", () => {\n\tconst path = Path.from(\"foo/bar\");\n\texpect(Path.stripPrefix(Path.from(\"notfound\"), path)).toBe(null);\n\texpect(Path.stripPrefix(Path.from(\"fo\"), path)).toBe(null);\n});\n\ntest(\"stripPrefix handles empty prefix\", () => {\n\tconst path = Path.from(\"foo/bar\");\n\tconst result = Path.stripPrefix(Path.empty(), path);\n\texpect(result).toBe(\"foo/bar\" as Path.Valid);\n});\n\ntest(\"stripPrefix accepts Path instances\", () => {\n\tconst path = Path.from(\"foo/bar/baz\");\n\tconst prefix = Path.from(\"foo/bar\");\n\tconst result = Path.stripPrefix(prefix, path);\n\texpect(result).toBe(\"baz\" as Path.Valid);\n});\n\ntest(\"join paths with slashes\", () => {\n\tconst base = Path.from(\"foo\");\n\tconst joined = Path.join(base, Path.from(\"bar\"));\n\texpect(joined).toBe(\"foo/bar\" as Path.Valid);\n});\n\ntest(\"join handles empty base\", () => {\n\tconst base = Path.empty();\n\tconst joined = Path.join(base, Path.from(\"bar\"));\n\texpect(joined).toBe(\"bar\" as Path.Valid);\n});\n\ntest(\"join handles empty suffix\", () => {\n\tconst base = Path.from(\"foo\");\n\tconst joined = Path.join(base, Path.empty());\n\texpect(joined).toBe(\"foo\" as Path.Valid);\n});\n\ntest(\"join accepts Path instances\", () => {\n\tconst base = Path.from(\"foo\");\n\tconst suffix = Path.from(\"bar\");\n\tconst joined = Path.join(base, suffix);\n\texpect(joined).toBe(\"foo/bar\" as Path.Valid);\n});\n\ntest(\"join handles multiple joins\", () => {\n\tconst path = Path.join(\n\t\tPath.join(Path.join(Path.from(\"api\"), Path.from(\"v1\")), Path.from(\"users\")),\n\t\tPath.from(\"123\"),\n\t);\n\texpect(path).toBe(\"api/v1/users/123\" as Path.Valid);\n});\n\ntest(\"isEmpty checks correctly\", () => {\n\texpect(Path.from(\"\") === \"\").toBe(true);\n\texpect(Path.from(\"foo\") === \"\").toBe(false);\n\texpect(Path.empty() === \"\").toBe(true);\n});\n\ntest(\"length property works correctly\", () => {\n\texpect(Path.from(\"foo\").length).toBe(3);\n\texpect(Path.from(\"foo/bar\").length).toBe(7);\n\texpect(Path.empty().length).toBe(0);\n});\n\ntest(\"equals checks correctly\", () => {\n\tconst path1 = Path.from(\"foo/bar\");\n\tconst path2 = Path.from(\"/foo/bar/\");\n\tconst path3 = Path.from(\"foo/baz\");\n\n\texpect(path1 === path2).toBe(true);\n\texpect(path1 === path3).toBe(false);\n});\n\ntest(\"JSON serialization works\", () => {\n\tconst path = Path.from(\"foo/bar\");\n\texpect(JSON.stringify(path)).toBe('\"foo/bar\"');\n});\n\ntest(\"handles paths with multiple consecutive slashes\", () => {\n\tconst path = Path.from(\"foo//bar///baz\");\n\t// Multiple consecutive slashes are collapsed to single slashes\n\texpect(path).toBe(\"foo/bar/baz\" as Path.Valid);\n});\n\ntest(\"removes multiple slashes comprehensively\", () => {\n\t// Test various multiple slash scenarios\n\texpect(Path.from(\"foo//bar\")).toBe(\"foo/bar\" as Path.Valid);\n\texpect(Path.from(\"foo///bar\")).toBe(\"foo/bar\" as Path.Valid);\n\texpect(Path.from(\"foo////bar\")).toBe(\"foo/bar\" as Path.Valid);\n\n\t// Multiple occurrences of double slashes\n\texpect(Path.from(\"foo//bar//baz\")).toBe(\"foo/bar/baz\" as Path.Valid);\n\texpect(Path.from(\"a//b//c//d\")).toBe(\"a/b/c/d\" as Path.Valid);\n\n\t// Mixed slash counts\n\texpect(Path.from(\"foo//bar///baz////qux\")).toBe(\"foo/bar/baz/qux\" as Path.Valid);\n\n\t// With leading and trailing slashes\n\texpect(Path.from(\"//foo//bar//\")).toBe(\"foo/bar\" as Path.Valid);\n\texpect(Path.from(\"///foo///bar///\")).toBe(\"foo/bar\" as Path.Valid);\n\n\t// Edge case: only slashes\n\texpect(Path.from(\"//\")).toBe(\"\" as Path.Valid);\n\texpect(Path.from(\"////\")).toBe(\"\" as Path.Valid);\n\n\t// Test that operations work correctly with normalized paths\n\tconst pathWithSlashes = Path.from(\"foo//bar///baz\");\n\texpect(Path.hasPrefix(Path.from(\"foo/bar\"), pathWithSlashes)).toBe(true);\n\texpect(Path.stripPrefix(Path.from(\"foo\"), pathWithSlashes)).toBe(\"bar/baz\" as Path.Valid);\n\texpect(Path.join(pathWithSlashes, Path.from(\"qux\"))).toBe(\"foo/bar/baz/qux\" as Path.Valid);\n});\n\ntest(\"handles special characters\", () => {\n\tconst path = Path.from(\"foo-bar_baz.txt\");\n\texpect(path).toBe(\"foo-bar_baz.txt\" as Path.Valid);\n\texpect(Path.hasPrefix(Path.from(\"foo-bar\"), path)).toBe(false);\n\texpect(Path.hasPrefix(Path.from(\"foo-bar_baz.txt\"), path)).toBe(true);\n});\n\ntest(\"from accepts multiple arguments\", () => {\n\texpect(Path.from(\"foo\", \"bar\", \"baz\")).toBe(\"foo/bar/baz\" as Path.Valid);\n\texpect(Path.from(\"api\", \"v1\", \"users\")).toBe(\"api/v1/users\" as Path.Valid);\n});\n\ntest(\"from handles empty strings in arguments\", () => {\n\texpect(Path.from(\"foo\", \"\", \"bar\")).toBe(\"foo/bar\" as Path.Valid);\n\texpect(Path.from(\"\", \"foo\", \"bar\", \"\")).toBe(\"foo/bar\" as Path.Valid);\n});\n\ntest(\"from sanitizes multiple arguments with slashes\", () => {\n\texpect(Path.from(\"/foo/\", \"/bar/\", \"/baz/\")).toBe(\"foo/bar/baz\" as Path.Valid);\n\texpect(Path.from(\"foo//\", \"//bar\", \"baz\")).toBe(\"foo/bar/baz\" as Path.Valid);\n});\n\ntest(\"resolve appends named segments\", () => {\n\texpect(Path.resolve(Path.from(\"a/b\"), \"c\")).toBe(Path.from(\"a/b/c\"));\n\texpect(Path.resolve(Path.from(\"a/b\"), \"c/d\")).toBe(Path.from(\"a/b/c/d\"));\n});\n\ntest(\"resolve with empty rel returns base\", () => {\n\texpect(Path.resolve(Path.from(\"a/b\"), \"\")).toBe(Path.from(\"a/b\"));\n});\n\ntest(\"resolve single dotdot pops one segment\", () => {\n\texpect(Path.resolve(Path.from(\"a/b/c\"), \"../d\")).toBe(Path.from(\"a/b/d\"));\n\texpect(Path.resolve(Path.from(\"a/b/c\"), \"..\")).toBe(Path.from(\"a/b\"));\n});\n\ntest(\"resolve multiple dotdot pops multiple segments\", () => {\n\texpect(Path.resolve(Path.from(\"a/b/c\"), \"../../x\")).toBe(Path.from(\"a/x\"));\n\texpect(Path.resolve(Path.from(\"a/b/c\"), \"../../../x\")).toBe(Path.from(\"x\"));\n});\n\ntest(\"resolve excess dotdot clamps at empty\", () => {\n\texpect(Path.resolve(Path.from(\"a\"), \"../../../foo\")).toBe(Path.from(\"foo\"));\n\texpect(Path.resolve(Path.from(\"a\"), \"..\")).toBe(Path.from(\"\"));\n});\n\ntest(\"resolve with empty base\", () => {\n\texpect(Path.resolve(Path.empty(), \"foo\")).toBe(Path.from(\"foo\"));\n\texpect(Path.resolve(Path.empty(), \"..\")).toBe(Path.from(\"\"));\n});\n\ntest(\"resolve treats dot as a no-op\", () => {\n\texpect(Path.resolve(Path.from(\"a/b\"), \".\")).toBe(Path.from(\"a/b\"));\n\texpect(Path.resolve(Path.from(\"a/b\"), \"./c\")).toBe(Path.from(\"a/b/c\"));\n\texpect(Path.resolve(Path.from(\"a/b\"), \"./../c\")).toBe(Path.from(\"a/c\"));\n\texpect(Path.resolve(Path.from(\"a/b\"), \"foo/./bar\")).toBe(Path.from(\"a/b/foo/bar\"));\n});\n\ntest(\"resolve self-reference via dotdot equals base\", () => {\n\texpect(Path.resolve(Path.from(\"a/b\"), \"../b\")).toBe(Path.from(\"a/b\"));\n});\n\ntest(\"normalizeRelative drops empty and dot segments\", () => {\n\texpect(Path.normalizeRelative(\"\")).toBe(\"\");\n\texpect(Path.normalizeRelative(\".\")).toBe(\"\");\n\texpect(Path.normalizeRelative(\"./foo\")).toBe(\"foo\");\n\texpect(Path.normalizeRelative(\"foo//bar\")).toBe(\"foo/bar\");\n\texpect(Path.normalizeRelative(\"foo/./bar\")).toBe(\"foo/bar\");\n\texpect(Path.normalizeRelative(\"/foo/\")).toBe(\"foo\");\n\texpect(Path.normalizeRelative(\"../foo\")).toBe(\"../foo\");\n});\n\ntest(\"parts splits a path into its components\", () => {\n\texpect(Path.parts(Path.from(\"\"))).toEqual([]);\n\texpect(Path.parts(Path.from(\"foo\"))).toEqual([\"foo\"]);\n\texpect(Path.parts(Path.from(\"/foo//bar/\"))).toEqual([\"foo\", \"bar\"]);\n});\n\ntest(\"decode enforces the max part count\", () => {\n\tconst atLimit = Array.from({ length: Path.MAX_PARTS }, (_, i) => `${i}`).join(\"/\");\n\texpect(Path.decode(atLimit)).toBe(atLimit as Path.Valid);\n\texpect(() => Path.decode(`${atLimit}/extra`)).toThrow();\n});\n\ntest(\"encode enforces the max part count\", () => {\n\tconst atLimit = Array.from({ length: Path.MAX_PARTS }, (_, i) => `${i}`).join(\"/\") as Path.Valid;\n\texpect(Path.encode(atLimit)).toBe(atLimit);\n\texpect(() => Path.encode(`${atLimit}/extra` as Path.Valid)).toThrow();\n});\n"]}
|
package/stream.test.d.ts
DELETED
package/stream.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.test.d.ts","sourceRoot":"","sources":["../src/stream.test.ts"],"names":[],"mappings":""}
|
package/stream.test.js
DELETED
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./stream.test.d.ts" */
|
|
2
|
-
import { expect, test } from "bun:test";
|
|
3
|
-
import { RemoteError } from "./error.js";
|
|
4
|
-
import { Reader, Writer } from "./stream.js";
|
|
5
|
-
// Helper to create a writable stream that captures written data
|
|
6
|
-
function createTestWritableStream() {
|
|
7
|
-
const written = [];
|
|
8
|
-
const stream = new WritableStream({
|
|
9
|
-
write(chunk) {
|
|
10
|
-
written.push(new Uint8Array(chunk));
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
return { stream, written };
|
|
14
|
-
}
|
|
15
|
-
// Helper to concatenate written chunks
|
|
16
|
-
function concatChunks(chunks) {
|
|
17
|
-
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.byteLength, 0);
|
|
18
|
-
const result = new Uint8Array(totalLength);
|
|
19
|
-
let offset = 0;
|
|
20
|
-
for (const chunk of chunks) {
|
|
21
|
-
result.set(chunk, offset);
|
|
22
|
-
offset += chunk.byteLength;
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
test("Writer u8", async () => {
|
|
27
|
-
const { stream, written } = createTestWritableStream();
|
|
28
|
-
const writer = new Writer(stream);
|
|
29
|
-
await writer.u8(42);
|
|
30
|
-
await writer.u8(255);
|
|
31
|
-
writer.close();
|
|
32
|
-
await writer.closed;
|
|
33
|
-
expect(written.length).toBe(2);
|
|
34
|
-
expect(written[0]).toEqual(new Uint8Array([42]));
|
|
35
|
-
expect(written[1]).toEqual(new Uint8Array([255]));
|
|
36
|
-
});
|
|
37
|
-
test("Writer i32", async () => {
|
|
38
|
-
const { stream, written } = createTestWritableStream();
|
|
39
|
-
const writer = new Writer(stream);
|
|
40
|
-
await writer.i32(0);
|
|
41
|
-
await writer.i32(-1);
|
|
42
|
-
await writer.i32(1000);
|
|
43
|
-
writer.close();
|
|
44
|
-
await writer.closed;
|
|
45
|
-
const result = concatChunks(written);
|
|
46
|
-
expect(result.byteLength).toBe(12); // 3 * 4 bytes
|
|
47
|
-
// Read back the values
|
|
48
|
-
const view = new DataView(result.buffer, result.byteOffset, result.byteLength);
|
|
49
|
-
expect(view.getInt32(0)).toBe(0);
|
|
50
|
-
expect(view.getInt32(4)).toBe(-1);
|
|
51
|
-
expect(view.getInt32(8)).toBe(1000);
|
|
52
|
-
});
|
|
53
|
-
test("Writer u53", async () => {
|
|
54
|
-
const { stream, written } = createTestWritableStream();
|
|
55
|
-
const writer = new Writer(stream);
|
|
56
|
-
await writer.u53(0);
|
|
57
|
-
await writer.u53(63); // MAX_U6
|
|
58
|
-
await writer.u53(64); // MIN for 2-byte varint
|
|
59
|
-
await writer.u53(16383); // MAX_U14
|
|
60
|
-
await writer.u53(16384); // MIN for 4-byte varint
|
|
61
|
-
writer.close();
|
|
62
|
-
await writer.closed;
|
|
63
|
-
// Verify the varint encoding sizes
|
|
64
|
-
expect(written[0].byteLength).toBe(1); // 0 fits in 1 byte
|
|
65
|
-
expect(written[1].byteLength).toBe(1); // 63 fits in 1 byte
|
|
66
|
-
expect(written[2].byteLength).toBe(2); // 64 needs 2 bytes
|
|
67
|
-
expect(written[3].byteLength).toBe(2); // 16383 fits in 2 bytes
|
|
68
|
-
expect(written[4].byteLength).toBe(4); // 16384 needs 4 bytes
|
|
69
|
-
});
|
|
70
|
-
test("Writer string", async () => {
|
|
71
|
-
const { stream, written } = createTestWritableStream();
|
|
72
|
-
const writer = new Writer(stream);
|
|
73
|
-
await writer.string("hello");
|
|
74
|
-
await writer.string("🎉");
|
|
75
|
-
writer.close();
|
|
76
|
-
await writer.closed;
|
|
77
|
-
const result = concatChunks(written);
|
|
78
|
-
// Create a reader to parse the result
|
|
79
|
-
const reader = new Reader(undefined, result);
|
|
80
|
-
const str1 = await reader.string();
|
|
81
|
-
const str2 = await reader.string();
|
|
82
|
-
expect(str1).toBe("hello");
|
|
83
|
-
expect(str2).toBe("🎉");
|
|
84
|
-
});
|
|
85
|
-
test("Reader u8", async () => {
|
|
86
|
-
const data = new Uint8Array([42, 255, 0, 128]);
|
|
87
|
-
const reader = new Reader(undefined, data);
|
|
88
|
-
expect(await reader.u8()).toBe(42);
|
|
89
|
-
expect(await reader.u8()).toBe(255);
|
|
90
|
-
expect(await reader.u8()).toBe(0);
|
|
91
|
-
expect(await reader.u8()).toBe(128);
|
|
92
|
-
expect(await reader.done()).toBe(true);
|
|
93
|
-
});
|
|
94
|
-
test("Reader read with exact sizes", async () => {
|
|
95
|
-
const data = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
|
|
96
|
-
const reader = new Reader(undefined, data);
|
|
97
|
-
const chunk1 = await reader.read(3);
|
|
98
|
-
expect(chunk1).toEqual(new Uint8Array([1, 2, 3]));
|
|
99
|
-
const chunk2 = await reader.read(2);
|
|
100
|
-
expect(chunk2).toEqual(new Uint8Array([4, 5]));
|
|
101
|
-
const chunk3 = await reader.read(3);
|
|
102
|
-
expect(chunk3).toEqual(new Uint8Array([6, 7, 8]));
|
|
103
|
-
expect(await reader.done()).toBe(true);
|
|
104
|
-
});
|
|
105
|
-
test("Reader read with zero size", async () => {
|
|
106
|
-
const data = new Uint8Array([1, 2, 3]);
|
|
107
|
-
const reader = new Reader(undefined, data);
|
|
108
|
-
const chunk = await reader.read(0);
|
|
109
|
-
expect(chunk).toEqual(new Uint8Array([]));
|
|
110
|
-
// Original data should still be available
|
|
111
|
-
const remaining = await reader.read(3);
|
|
112
|
-
expect(remaining).toEqual(new Uint8Array([1, 2, 3]));
|
|
113
|
-
});
|
|
114
|
-
test("Reader readAll", async () => {
|
|
115
|
-
const data = new Uint8Array([1, 2, 3, 4, 5]);
|
|
116
|
-
const reader = new Reader(undefined, data);
|
|
117
|
-
// Read some data first
|
|
118
|
-
await reader.read(2);
|
|
119
|
-
// readAll should get the remaining data
|
|
120
|
-
const remaining = await reader.readAll();
|
|
121
|
-
expect(remaining).toEqual(new Uint8Array([3, 4, 5]));
|
|
122
|
-
expect(await reader.done()).toBe(true);
|
|
123
|
-
});
|
|
124
|
-
test("Reader u53 varint decoding", async () => {
|
|
125
|
-
// Test various varint sizes
|
|
126
|
-
const testValues = [0, 63, 64, 16383, 16384, 1073741823, 1073741824];
|
|
127
|
-
const { stream, written } = createTestWritableStream();
|
|
128
|
-
const testWriter = new Writer(stream);
|
|
129
|
-
for (const value of testValues) {
|
|
130
|
-
await testWriter.u53(value);
|
|
131
|
-
}
|
|
132
|
-
testWriter.close();
|
|
133
|
-
await testWriter.closed;
|
|
134
|
-
const data = concatChunks(written);
|
|
135
|
-
const reader = new Reader(undefined, data);
|
|
136
|
-
for (const expectedValue of testValues) {
|
|
137
|
-
const actualValue = await reader.u53();
|
|
138
|
-
expect(actualValue).toBe(expectedValue);
|
|
139
|
-
}
|
|
140
|
-
expect(await reader.done()).toBe(true);
|
|
141
|
-
});
|
|
142
|
-
test("Reader u62 varint decoding", async () => {
|
|
143
|
-
const testValues = [0n, 63n, 64n, 16383n, 16384n, 1073741823n, 1073741824n, 9007199254740991n]; // MAX_U53
|
|
144
|
-
const { stream, written } = createTestWritableStream();
|
|
145
|
-
const testWriter = new Writer(stream);
|
|
146
|
-
for (const value of testValues) {
|
|
147
|
-
await testWriter.u62(value);
|
|
148
|
-
}
|
|
149
|
-
testWriter.close();
|
|
150
|
-
await testWriter.closed;
|
|
151
|
-
const data = concatChunks(written);
|
|
152
|
-
const reader = new Reader(undefined, data);
|
|
153
|
-
for (const expectedValue of testValues) {
|
|
154
|
-
const actualValue = await reader.u62();
|
|
155
|
-
expect(actualValue).toBe(expectedValue);
|
|
156
|
-
}
|
|
157
|
-
expect(await reader.done()).toBe(true);
|
|
158
|
-
});
|
|
159
|
-
test("Reader string decoding", async () => {
|
|
160
|
-
const testStrings = ["hello", "🎉", "", "world with spaces", "multi\nline\nstring"];
|
|
161
|
-
const { stream, written } = createTestWritableStream();
|
|
162
|
-
const writer = new Writer(stream);
|
|
163
|
-
for (const str of testStrings) {
|
|
164
|
-
await writer.string(str);
|
|
165
|
-
}
|
|
166
|
-
writer.close();
|
|
167
|
-
await writer.closed;
|
|
168
|
-
const data = concatChunks(written);
|
|
169
|
-
const reader = new Reader(undefined, data);
|
|
170
|
-
for (const expectedString of testStrings) {
|
|
171
|
-
const actualString = await reader.string();
|
|
172
|
-
expect(actualString).toBe(expectedString);
|
|
173
|
-
}
|
|
174
|
-
expect(await reader.done()).toBe(true);
|
|
175
|
-
});
|
|
176
|
-
test("Reader from stream", async () => {
|
|
177
|
-
const chunks = [new Uint8Array([1, 2, 3]), new Uint8Array([4, 5]), new Uint8Array([6, 7, 8, 9])];
|
|
178
|
-
const stream = new ReadableStream({
|
|
179
|
-
start(controller) {
|
|
180
|
-
for (const chunk of chunks) {
|
|
181
|
-
controller.enqueue(chunk);
|
|
182
|
-
}
|
|
183
|
-
controller.close();
|
|
184
|
-
},
|
|
185
|
-
});
|
|
186
|
-
const reader = new Reader(stream);
|
|
187
|
-
// Read all data
|
|
188
|
-
const result = await reader.readAll();
|
|
189
|
-
expect(result).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]));
|
|
190
|
-
});
|
|
191
|
-
test("Reader stream with partial reads", async () => {
|
|
192
|
-
const chunks = [new Uint8Array([1, 2]), new Uint8Array([3, 4, 5]), new Uint8Array([6])];
|
|
193
|
-
const stream = new ReadableStream({
|
|
194
|
-
start(controller) {
|
|
195
|
-
for (const chunk of chunks) {
|
|
196
|
-
controller.enqueue(chunk);
|
|
197
|
-
}
|
|
198
|
-
controller.close();
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
const reader = new Reader(stream);
|
|
202
|
-
// Read specific amounts that cross chunk boundaries
|
|
203
|
-
const first = await reader.read(3); // Should span first two chunks
|
|
204
|
-
expect(first).toEqual(new Uint8Array([1, 2, 3]));
|
|
205
|
-
const second = await reader.read(2);
|
|
206
|
-
expect(second).toEqual(new Uint8Array([4, 5]));
|
|
207
|
-
const third = await reader.read(1);
|
|
208
|
-
expect(third).toEqual(new Uint8Array([6]));
|
|
209
|
-
expect(await reader.done()).toBe(true);
|
|
210
|
-
});
|
|
211
|
-
test("Reader u53 decodes two-byte stream type prefixes", async () => {
|
|
212
|
-
const { stream, written } = createTestWritableStream();
|
|
213
|
-
const writer = new Writer(stream);
|
|
214
|
-
await writer.u53(0x40);
|
|
215
|
-
writer.close();
|
|
216
|
-
await writer.closed;
|
|
217
|
-
const reader = new Reader(undefined, concatChunks(written));
|
|
218
|
-
expect(await reader.u53()).toBe(0x40);
|
|
219
|
-
expect(await reader.done()).toBe(true);
|
|
220
|
-
});
|
|
221
|
-
/** A stream reset as a transport delivers one: the peer's code, and nothing else useful. */
|
|
222
|
-
class Reset extends Error {
|
|
223
|
-
source = "stream";
|
|
224
|
-
streamErrorCode;
|
|
225
|
-
constructor(code) {
|
|
226
|
-
super("");
|
|
227
|
-
this.streamErrorCode = code;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
test("Reader closed rejects with the decoded reset code", async () => {
|
|
231
|
-
// Protocol paths race `closed` against a read, so the two must agree on the error
|
|
232
|
-
// shape: whichever wins, the reset code reaches the caller the same way.
|
|
233
|
-
const reader = new Reader(new ReadableStream({
|
|
234
|
-
start: (controller) => controller.error(new Reset(2)),
|
|
235
|
-
}));
|
|
236
|
-
const err = await reader.closed.then(() => undefined, (e) => e);
|
|
237
|
-
expect(err).toBeInstanceOf(RemoteError);
|
|
238
|
-
expect(err.code).toBe(2);
|
|
239
|
-
});
|
|
240
|
-
test("Writer closed rejects with the decoded reset code", async () => {
|
|
241
|
-
const writer = new Writer(new WritableStream({
|
|
242
|
-
start: (controller) => controller.error(new Reset(31)),
|
|
243
|
-
}));
|
|
244
|
-
const err = await writer.closed.then(() => undefined, (e) => e);
|
|
245
|
-
expect(err).toBeInstanceOf(RemoteError);
|
|
246
|
-
expect(err.code).toBe(31);
|
|
247
|
-
});
|
|
248
|
-
test("closed is stable, so racing it per frame does not allocate", async () => {
|
|
249
|
-
const reader = new Reader(new ReadableStream());
|
|
250
|
-
expect(reader.closed).toBe(reader.closed);
|
|
251
|
-
});
|
|
252
|
-
//# sourceMappingURL=stream.test.js.map
|
package/stream.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.test.js","sourceRoot":"","sources":["../src/stream.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE7C,gEAAgE;AAChE,SAAS,wBAAwB;IAChC,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,cAAc,CAAa;QAC7C,KAAK,CAAC,KAAK;YACV,OAAO,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,CAAC;KACD,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC;AAED,uCAAuC;AACvC,SAAS,YAAY,CAAC,MAAoB;IACzC,MAA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AE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;KACtD,CAAC,CACF,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CACnC,GAAG,EAAE,CAAC,SAAS,EACf,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,CACjB,CAAC;IACF,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACxC,MAAM,CAAE,GAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;IAC7E,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,cAAc,EAAc,CAAC,CAAC;IAC5D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC","sourcesContent":["import { expect, test } from \"bun:test\";\nimport { RemoteError } from \"./error.ts\";\nimport { Reader, Writer } from \"./stream.ts\";\n\n// Helper to create a writable stream that captures written data\nfunction createTestWritableStream(): { stream: WritableStream<Uint8Array>; written: Uint8Array[] } {\n\tconst written: Uint8Array[] = [];\n\tconst stream = new WritableStream<Uint8Array>({\n\t\twrite(chunk) {\n\t\t\twritten.push(new Uint8Array(chunk));\n\t\t},\n\t});\n\treturn { stream, written };\n}\n\n// Helper to concatenate written chunks\nfunction concatChunks(chunks: Uint8Array[]): Uint8Array {\n\tconst totalLength = chunks.reduce((sum, chunk) => sum + chunk.byteLength, 0);\n\tconst result = new Uint8Array(totalLength);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tresult.set(chunk, offset);\n\t\toffset += chunk.byteLength;\n\t}\n\treturn result;\n}\n\ntest(\"Writer u8\", async () => {\n\tconst { stream, written } = createTestWritableStream();\n\tconst writer = new Writer(stream);\n\n\tawait writer.u8(42);\n\tawait writer.u8(255);\n\n\twriter.close();\n\tawait writer.closed;\n\n\texpect(written.length).toBe(2);\n\texpect(written[0]).toEqual(new Uint8Array([42]));\n\texpect(written[1]).toEqual(new Uint8Array([255]));\n});\n\ntest(\"Writer i32\", async () => {\n\tconst { stream, written } = createTestWritableStream();\n\tconst writer = new Writer(stream);\n\n\tawait writer.i32(0);\n\tawait writer.i32(-1);\n\tawait writer.i32(1000);\n\n\twriter.close();\n\tawait writer.closed;\n\n\tconst result = concatChunks(written);\n\texpect(result.byteLength).toBe(12); // 3 * 4 bytes\n\n\t// Read back the values\n\tconst view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n\texpect(view.getInt32(0)).toBe(0);\n\texpect(view.getInt32(4)).toBe(-1);\n\texpect(view.getInt32(8)).toBe(1000);\n});\n\ntest(\"Writer u53\", async () => {\n\tconst { stream, written } = createTestWritableStream();\n\tconst writer = new Writer(stream);\n\n\tawait writer.u53(0);\n\tawait writer.u53(63); // MAX_U6\n\tawait writer.u53(64); // MIN for 2-byte varint\n\tawait writer.u53(16383); // MAX_U14\n\tawait writer.u53(16384); // MIN for 4-byte varint\n\n\twriter.close();\n\tawait writer.closed;\n\n\t// Verify the varint encoding sizes\n\texpect(written[0].byteLength).toBe(1); // 0 fits in 1 byte\n\texpect(written[1].byteLength).toBe(1); // 63 fits in 1 byte\n\texpect(written[2].byteLength).toBe(2); // 64 needs 2 bytes\n\texpect(written[3].byteLength).toBe(2); // 16383 fits in 2 bytes\n\texpect(written[4].byteLength).toBe(4); // 16384 needs 4 bytes\n});\n\ntest(\"Writer string\", async () => {\n\tconst { stream, written } = createTestWritableStream();\n\tconst writer = new Writer(stream);\n\n\tawait writer.string(\"hello\");\n\tawait writer.string(\"🎉\");\n\n\twriter.close();\n\tawait writer.closed;\n\n\tconst result = concatChunks(written);\n\n\t// Create a reader to parse the result\n\tconst reader = new Reader(undefined, result);\n\n\tconst str1 = await reader.string();\n\tconst str2 = await reader.string();\n\n\texpect(str1).toBe(\"hello\");\n\texpect(str2).toBe(\"🎉\");\n});\n\ntest(\"Reader u8\", async () => {\n\tconst data = new Uint8Array([42, 255, 0, 128]);\n\tconst reader = new Reader(undefined, data);\n\n\texpect(await reader.u8()).toBe(42);\n\texpect(await reader.u8()).toBe(255);\n\texpect(await reader.u8()).toBe(0);\n\texpect(await reader.u8()).toBe(128);\n\n\texpect(await reader.done()).toBe(true);\n});\n\ntest(\"Reader read with exact sizes\", async () => {\n\tconst data = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);\n\tconst reader = new Reader(undefined, data);\n\n\tconst chunk1 = await reader.read(3);\n\texpect(chunk1).toEqual(new Uint8Array([1, 2, 3]));\n\n\tconst chunk2 = await reader.read(2);\n\texpect(chunk2).toEqual(new Uint8Array([4, 5]));\n\n\tconst chunk3 = await reader.read(3);\n\texpect(chunk3).toEqual(new Uint8Array([6, 7, 8]));\n\n\texpect(await reader.done()).toBe(true);\n});\n\ntest(\"Reader read with zero size\", async () => {\n\tconst data = new Uint8Array([1, 2, 3]);\n\tconst reader = new Reader(undefined, data);\n\n\tconst chunk = await reader.read(0);\n\texpect(chunk).toEqual(new Uint8Array([]));\n\n\t// Original data should still be available\n\tconst remaining = await reader.read(3);\n\texpect(remaining).toEqual(new Uint8Array([1, 2, 3]));\n});\n\ntest(\"Reader readAll\", async () => {\n\tconst data = new Uint8Array([1, 2, 3, 4, 5]);\n\tconst reader = new Reader(undefined, data);\n\n\t// Read some data first\n\tawait reader.read(2);\n\n\t// readAll should get the remaining data\n\tconst remaining = await reader.readAll();\n\texpect(remaining).toEqual(new Uint8Array([3, 4, 5]));\n\n\texpect(await reader.done()).toBe(true);\n});\n\ntest(\"Reader u53 varint decoding\", async () => {\n\t// Test various varint sizes\n\tconst testValues = [0, 63, 64, 16383, 16384, 1073741823, 1073741824];\n\n\tconst { stream, written } = createTestWritableStream();\n\tconst testWriter = new Writer(stream);\n\n\tfor (const value of testValues) {\n\t\tawait testWriter.u53(value);\n\t}\n\n\ttestWriter.close();\n\tawait testWriter.closed;\n\n\tconst data = concatChunks(written);\n\tconst reader = new Reader(undefined, data);\n\n\tfor (const expectedValue of testValues) {\n\t\tconst actualValue = await reader.u53();\n\t\texpect(actualValue).toBe(expectedValue);\n\t}\n\n\texpect(await reader.done()).toBe(true);\n});\n\ntest(\"Reader u62 varint decoding\", async () => {\n\tconst testValues = [0n, 63n, 64n, 16383n, 16384n, 1073741823n, 1073741824n, 9007199254740991n]; // MAX_U53\n\n\tconst { stream, written } = createTestWritableStream();\n\tconst testWriter = new Writer(stream);\n\n\tfor (const value of testValues) {\n\t\tawait testWriter.u62(value);\n\t}\n\n\ttestWriter.close();\n\tawait testWriter.closed;\n\n\tconst data = concatChunks(written);\n\tconst reader = new Reader(undefined, data);\n\n\tfor (const expectedValue of testValues) {\n\t\tconst actualValue = await reader.u62();\n\t\texpect(actualValue).toBe(expectedValue);\n\t}\n\n\texpect(await reader.done()).toBe(true);\n});\n\ntest(\"Reader string decoding\", async () => {\n\tconst testStrings = [\"hello\", \"🎉\", \"\", \"world with spaces\", \"multi\\nline\\nstring\"];\n\n\tconst { stream, written } = createTestWritableStream();\n\tconst writer = new Writer(stream);\n\n\tfor (const str of testStrings) {\n\t\tawait writer.string(str);\n\t}\n\n\twriter.close();\n\tawait writer.closed;\n\n\tconst data = concatChunks(written);\n\tconst reader = new Reader(undefined, data);\n\n\tfor (const expectedString of testStrings) {\n\t\tconst actualString = await reader.string();\n\t\texpect(actualString).toBe(expectedString);\n\t}\n\n\texpect(await reader.done()).toBe(true);\n});\n\ntest(\"Reader from stream\", async () => {\n\tconst chunks = [new Uint8Array([1, 2, 3]), new Uint8Array([4, 5]), new Uint8Array([6, 7, 8, 9])];\n\n\tconst stream = new ReadableStream({\n\t\tstart(controller) {\n\t\t\tfor (const chunk of chunks) {\n\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t}\n\t\t\tcontroller.close();\n\t\t},\n\t});\n\n\tconst reader = new Reader(stream);\n\n\t// Read all data\n\tconst result = await reader.readAll();\n\texpect(result).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]));\n});\n\ntest(\"Reader stream with partial reads\", async () => {\n\tconst chunks = [new Uint8Array([1, 2]), new Uint8Array([3, 4, 5]), new Uint8Array([6])];\n\n\tconst stream = new ReadableStream({\n\t\tstart(controller) {\n\t\t\tfor (const chunk of chunks) {\n\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t}\n\t\t\tcontroller.close();\n\t\t},\n\t});\n\n\tconst reader = new Reader(stream);\n\n\t// Read specific amounts that cross chunk boundaries\n\tconst first = await reader.read(3); // Should span first two chunks\n\texpect(first).toEqual(new Uint8Array([1, 2, 3]));\n\n\tconst second = await reader.read(2);\n\texpect(second).toEqual(new Uint8Array([4, 5]));\n\n\tconst third = await reader.read(1);\n\texpect(third).toEqual(new Uint8Array([6]));\n\n\texpect(await reader.done()).toBe(true);\n});\n\ntest(\"Reader u53 decodes two-byte stream type prefixes\", async () => {\n\tconst { stream, written } = createTestWritableStream();\n\tconst writer = new Writer(stream);\n\n\tawait writer.u53(0x40);\n\twriter.close();\n\tawait writer.closed;\n\n\tconst reader = new Reader(undefined, concatChunks(written));\n\texpect(await reader.u53()).toBe(0x40);\n\texpect(await reader.done()).toBe(true);\n});\n\n/** A stream reset as a transport delivers one: the peer's code, and nothing else useful. */\nclass Reset extends Error {\n\treadonly source = \"stream\" as const;\n\treadonly streamErrorCode: number;\n\n\tconstructor(code: number) {\n\t\tsuper(\"\");\n\t\tthis.streamErrorCode = code;\n\t}\n}\n\ntest(\"Reader closed rejects with the decoded reset code\", async () => {\n\t// Protocol paths race `closed` against a read, so the two must agree on the error\n\t// shape: whichever wins, the reset code reaches the caller the same way.\n\tconst reader = new Reader(\n\t\tnew ReadableStream<Uint8Array>({\n\t\t\tstart: (controller) => controller.error(new Reset(2)),\n\t\t}),\n\t);\n\n\tconst err = await reader.closed.then(\n\t\t() => undefined,\n\t\t(e: unknown) => e,\n\t);\n\texpect(err).toBeInstanceOf(RemoteError);\n\texpect((err as RemoteError).code).toBe(2);\n});\n\ntest(\"Writer closed rejects with the decoded reset code\", async () => {\n\tconst writer = new Writer(\n\t\tnew WritableStream<Uint8Array>({\n\t\t\tstart: (controller) => controller.error(new Reset(31)),\n\t\t}),\n\t);\n\n\tconst err = await writer.closed.then(\n\t\t() => undefined,\n\t\t(e: unknown) => e,\n\t);\n\texpect(err).toBeInstanceOf(RemoteError);\n\texpect((err as RemoteError).code).toBe(31);\n});\n\ntest(\"closed is stable, so racing it per frame does not allocate\", async () => {\n\tconst reader = new Reader(new ReadableStream<Uint8Array>());\n\texpect(reader.closed).toBe(reader.closed);\n});\n"]}
|
package/time.test.d.ts
DELETED
package/time.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time.test.d.ts","sourceRoot":"","sources":["../src/time.test.ts"],"names":[],"mappings":""}
|
package/time.test.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./time.test.d.ts" */
|
|
2
|
-
import { expect, test } from "bun:test";
|
|
3
|
-
import { Timescale, Timestamp } from "./time.js";
|
|
4
|
-
test("Timestamp rejects negative values", () => {
|
|
5
|
-
expect(() => new Timestamp(-1, Timescale.MILLI)).toThrow();
|
|
6
|
-
expect(() => Timestamp.fromMicros(-1)).toThrow();
|
|
7
|
-
});
|
|
8
|
-
test("Timestamp rejects non-finite values", () => {
|
|
9
|
-
expect(() => new Timestamp(Number.NaN, Timescale.MILLI)).toThrow();
|
|
10
|
-
expect(() => Timestamp.fromMillis(Number.POSITIVE_INFINITY)).toThrow();
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=time.test.js.map
|
package/time.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time.test.js","sourceRoot":"","sources":["../src/time.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEjD,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3D,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;IAChD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACnE,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AACxE,CAAC,CAAC,CAAC","sourcesContent":["import { expect, test } from \"bun:test\";\nimport { Timescale, Timestamp } from \"./time.ts\";\n\ntest(\"Timestamp rejects negative values\", () => {\n\texpect(() => new Timestamp(-1, Timescale.MILLI)).toThrow();\n\texpect(() => Timestamp.fromMicros(-1)).toThrow();\n});\n\ntest(\"Timestamp rejects non-finite values\", () => {\n\texpect(() => new Timestamp(Number.NaN, Timescale.MILLI)).toThrow();\n\texpect(() => Timestamp.fromMillis(Number.POSITIVE_INFINITY)).toThrow();\n});\n"]}
|
package/track.test.d.ts
DELETED
package/track.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"track.test.d.ts","sourceRoot":"","sources":["../src/track.test.ts"],"names":[],"mappings":""}
|
package/track.test.js
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./track.test.d.ts" */
|
|
2
|
-
import { expect, test } from "bun:test";
|
|
3
|
-
import { Producer as GroupProducer } from "./group.js";
|
|
4
|
-
import { Timestamp } from "./time.js";
|
|
5
|
-
import { Producer as TrackProducer } from "./track.js";
|
|
6
|
-
const enc = new TextEncoder();
|
|
7
|
-
const dec = new TextDecoder();
|
|
8
|
-
test("used reflects subscriber demand and unused resolves when the last one leaves", async () => {
|
|
9
|
-
const producer = new TrackProducer("test");
|
|
10
|
-
// No subscribers: no demand.
|
|
11
|
-
expect(producer.used.peek()).toBe(false);
|
|
12
|
-
const a = producer.subscribe();
|
|
13
|
-
const b = producer.subscribe();
|
|
14
|
-
expect(producer.used.peek()).toBe(true);
|
|
15
|
-
// Closing one of two keeps demand, so unused() stays pending.
|
|
16
|
-
a.close();
|
|
17
|
-
expect(producer.used.peek()).toBe(true);
|
|
18
|
-
// Closing the last subscriber drops demand; unused() resolves. The consumer wire awaits this
|
|
19
|
-
// to tear an idle upstream down.
|
|
20
|
-
b.close();
|
|
21
|
-
await producer.unused();
|
|
22
|
-
expect(producer.used.peek()).toBe(false);
|
|
23
|
-
});
|
|
24
|
-
test("a producer never self-closes on zero demand: a publisher keeps serving new subscribers", async () => {
|
|
25
|
-
const producer = new TrackProducer("video");
|
|
26
|
-
// Demand comes and goes...
|
|
27
|
-
const a = producer.subscribe();
|
|
28
|
-
a.close();
|
|
29
|
-
await producer.unused();
|
|
30
|
-
// ...but the producer stays open (only the wire acts on `unused`, not the producer itself),
|
|
31
|
-
// so a publisher writing to a track nobody is watching is unaffected.
|
|
32
|
-
expect(producer.closed.peek()).toBeUndefined();
|
|
33
|
-
// A later subscriber still works and replays the cache.
|
|
34
|
-
producer.writeString("still here");
|
|
35
|
-
const b = producer.subscribe();
|
|
36
|
-
expect(await b.readString()).toBe("still here");
|
|
37
|
-
expect(producer.used.peek()).toBe(true);
|
|
38
|
-
});
|
|
39
|
-
test("unused() resolves immediately when there was never any demand", async () => {
|
|
40
|
-
const producer = new TrackProducer("video");
|
|
41
|
-
// No subscriber was ever attached; unused() must not hang.
|
|
42
|
-
await producer.unused();
|
|
43
|
-
expect(producer.used.peek()).toBe(false);
|
|
44
|
-
});
|
|
45
|
-
test("used stays true across churn while at least one subscriber remains", async () => {
|
|
46
|
-
const producer = new TrackProducer("video");
|
|
47
|
-
const a = producer.subscribe();
|
|
48
|
-
// Rapidly add and drop extra subscribers; `a` keeps demand asserted throughout.
|
|
49
|
-
for (let i = 0; i < 20; i++) {
|
|
50
|
-
const t = producer.subscribe();
|
|
51
|
-
t.close();
|
|
52
|
-
expect(producer.used.peek()).toBe(true);
|
|
53
|
-
}
|
|
54
|
-
a.close();
|
|
55
|
-
await producer.unused();
|
|
56
|
-
expect(producer.used.peek()).toBe(false);
|
|
57
|
-
});
|
|
58
|
-
test("appendDatagram shares the group sequence counter", () => {
|
|
59
|
-
const producer = new TrackProducer("test");
|
|
60
|
-
const ts = Timestamp.fromMillis(10);
|
|
61
|
-
// Interleave groups and datagrams: they draw from one monotonic counter.
|
|
62
|
-
expect(producer.appendGroup().sequence).toBe(0);
|
|
63
|
-
expect(producer.appendDatagram(ts, enc.encode("a"))).toBe(1);
|
|
64
|
-
expect(producer.appendGroup().sequence).toBe(2);
|
|
65
|
-
expect(producer.appendDatagram(ts, enc.encode("b"))).toBe(3);
|
|
66
|
-
});
|
|
67
|
-
test("appendDatagram delivers to a subscriber", async () => {
|
|
68
|
-
const producer = new TrackProducer("test");
|
|
69
|
-
const track = producer.subscribe();
|
|
70
|
-
const ts = Timestamp.fromMillis(42);
|
|
71
|
-
const seq = producer.appendDatagram(ts, enc.encode("hello"));
|
|
72
|
-
const got = await track.recvDatagram();
|
|
73
|
-
expect(got?.sequence).toBe(seq);
|
|
74
|
-
expect(got?.timestamp).toBe(ts);
|
|
75
|
-
expect(got && dec.decode(got.payload)).toBe("hello");
|
|
76
|
-
});
|
|
77
|
-
test("writeDatagram preserves an explicit sequence", async () => {
|
|
78
|
-
const producer = new TrackProducer("test");
|
|
79
|
-
const track = producer.subscribe();
|
|
80
|
-
// A relay forwarding an upstream datagram keeps its sequence number.
|
|
81
|
-
producer.writeDatagram({ sequence: 100, timestamp: Timestamp.fromMillis(5), payload: enc.encode("x") });
|
|
82
|
-
expect((await track.recvDatagram())?.sequence).toBe(100);
|
|
83
|
-
// The shared counter advanced past it, so the next appended group continues from 101.
|
|
84
|
-
expect(producer.appendGroup().sequence).toBe(101);
|
|
85
|
-
});
|
|
86
|
-
test("recvDatagram advances the ordered group cursor", async () => {
|
|
87
|
-
const producer = new TrackProducer("test");
|
|
88
|
-
const track = producer.subscribe();
|
|
89
|
-
producer.writeDatagram({ sequence: 5, timestamp: Timestamp.fromMillis(5), payload: enc.encode("x") });
|
|
90
|
-
expect((await track.recvDatagram())?.sequence).toBe(5);
|
|
91
|
-
// Ordered group reads treat lower sequences as late once a datagram used sequence 5.
|
|
92
|
-
producer.writeGroup(new GroupProducer(3));
|
|
93
|
-
producer.writeGroup(new GroupProducer(6));
|
|
94
|
-
expect((await track.nextGroup())?.sequence).toBe(6);
|
|
95
|
-
});
|
|
96
|
-
test("appendDatagram rejects a payload over the QUIC datagram frame ceiling", () => {
|
|
97
|
-
const producer = new TrackProducer("test");
|
|
98
|
-
expect(() => producer.appendDatagram(Timestamp.fromMillis(0), new Uint8Array(65536))).toThrow();
|
|
99
|
-
});
|
|
100
|
-
test("subscriber options and updates are forwarded to the producer's aggregate", async () => {
|
|
101
|
-
const producer = new TrackProducer("test");
|
|
102
|
-
const track = producer.subscribe({ startGroup: 0 });
|
|
103
|
-
// The initial options are available before the request is accepted or put on the wire.
|
|
104
|
-
expect(producer.subscription.peek()).toEqual({
|
|
105
|
-
priority: 0,
|
|
106
|
-
ordered: false,
|
|
107
|
-
latencyMax: 0,
|
|
108
|
-
startGroup: 0,
|
|
109
|
-
endGroup: undefined,
|
|
110
|
-
});
|
|
111
|
-
// The wire layer watches the producer's signal to emit SUBSCRIBE_UPDATE.
|
|
112
|
-
const next = producer.subscription.changed();
|
|
113
|
-
track.update({ priority: 7, ordered: true, latencyMax: 250, startGroup: 2, endGroup: 9 });
|
|
114
|
-
expect(await next).toEqual({ priority: 7, ordered: true, latencyMax: 250, startGroup: 2, endGroup: 9 });
|
|
115
|
-
});
|
|
116
|
-
test("multiple subscriber options aggregate like Rust", async () => {
|
|
117
|
-
const producer = new TrackProducer("test");
|
|
118
|
-
const bounded = producer.subscribe({ priority: 2, ordered: true, latencyMax: 100, startGroup: 10, endGroup: 20 });
|
|
119
|
-
const live = producer.subscribe({ priority: 7, ordered: false, latencyMax: 250, startGroup: 5 });
|
|
120
|
-
expect(producer.subscription.peek()).toEqual({
|
|
121
|
-
priority: 7,
|
|
122
|
-
ordered: false,
|
|
123
|
-
latencyMax: 250,
|
|
124
|
-
startGroup: 5,
|
|
125
|
-
endGroup: undefined,
|
|
126
|
-
});
|
|
127
|
-
const narrowed = producer.subscription.changed();
|
|
128
|
-
live.close();
|
|
129
|
-
expect(await narrowed).toEqual({
|
|
130
|
-
priority: 2,
|
|
131
|
-
ordered: true,
|
|
132
|
-
latencyMax: 100,
|
|
133
|
-
startGroup: 10,
|
|
134
|
-
endGroup: 20,
|
|
135
|
-
});
|
|
136
|
-
const none = producer.subscription.changed();
|
|
137
|
-
bounded.close();
|
|
138
|
-
expect(await none).toBeUndefined();
|
|
139
|
-
});
|
|
140
|
-
test("nextGroup skips late arrivals", async () => {
|
|
141
|
-
const producer = new TrackProducer("test");
|
|
142
|
-
const track = producer.subscribe();
|
|
143
|
-
producer.writeGroup(new GroupProducer(5));
|
|
144
|
-
const first = await track.nextGroup();
|
|
145
|
-
expect(first?.sequence).toBe(5);
|
|
146
|
-
// Late arrivals with sequence <= last returned are skipped.
|
|
147
|
-
producer.writeGroup(new GroupProducer(3));
|
|
148
|
-
producer.writeGroup(new GroupProducer(4));
|
|
149
|
-
producer.writeGroup(new GroupProducer(7));
|
|
150
|
-
const next = await track.nextGroup();
|
|
151
|
-
expect(next?.sequence).toBe(7);
|
|
152
|
-
});
|
|
153
|
-
test("nextGroup returns buffered groups in sequence", async () => {
|
|
154
|
-
const producer = new TrackProducer("test");
|
|
155
|
-
const track = producer.subscribe();
|
|
156
|
-
producer.writeGroup(new GroupProducer(3));
|
|
157
|
-
producer.writeGroup(new GroupProducer(5));
|
|
158
|
-
expect((await track.nextGroup())?.sequence).toBe(3);
|
|
159
|
-
expect((await track.nextGroup())?.sequence).toBe(5);
|
|
160
|
-
});
|
|
161
|
-
test("local cursor bounds can skip, pause, and release buffered groups", async () => {
|
|
162
|
-
const producer = new TrackProducer("test");
|
|
163
|
-
const track = producer.subscribe();
|
|
164
|
-
for (let sequence = 0; sequence < 5; sequence++)
|
|
165
|
-
producer.writeGroup(new GroupProducer(sequence));
|
|
166
|
-
expect(track.latest()).toBe(4);
|
|
167
|
-
track.startAt(1);
|
|
168
|
-
track.endAt(2);
|
|
169
|
-
expect((await track.nextGroup())?.sequence).toBe(1);
|
|
170
|
-
expect((await track.nextGroup())?.sequence).toBe(2);
|
|
171
|
-
const pending = track.nextGroup();
|
|
172
|
-
expect(await Promise.race([pending, Promise.resolve("pending")])).toBe("pending");
|
|
173
|
-
track.startAt(4);
|
|
174
|
-
track.endAt(4);
|
|
175
|
-
expect((await pending)?.sequence).toBe(4);
|
|
176
|
-
});
|
|
177
|
-
test("recvGroup after nextGroup still returns late arrivals", async () => {
|
|
178
|
-
const producer = new TrackProducer("test");
|
|
179
|
-
const track = producer.subscribe();
|
|
180
|
-
producer.writeGroup(new GroupProducer(5));
|
|
181
|
-
// Ordered returns seq 5, advancing its cursor.
|
|
182
|
-
const ordered = await track.nextGroup();
|
|
183
|
-
expect(ordered?.sequence).toBe(5);
|
|
184
|
-
// recvGroup is independent of the ordered cursor: a late seq 3 still surfaces.
|
|
185
|
-
producer.writeGroup(new GroupProducer(3));
|
|
186
|
-
const recv = await track.recvGroup();
|
|
187
|
-
expect(recv?.sequence).toBe(3);
|
|
188
|
-
});
|
|
189
|
-
test("nextGroup returns undefined when track closes", async () => {
|
|
190
|
-
const producer = new TrackProducer("test");
|
|
191
|
-
const track = producer.subscribe();
|
|
192
|
-
producer.close();
|
|
193
|
-
expect(await track.nextGroup()).toBeUndefined();
|
|
194
|
-
});
|
|
195
|
-
test("readFrame does not livelock when a sole group finishes before the next arrives", async () => {
|
|
196
|
-
const producer = new TrackProducer("test");
|
|
197
|
-
const track = producer.subscribe();
|
|
198
|
-
// A group is appended then finished empty while the track stays open. A finished group's
|
|
199
|
-
// readable() resolves immediately, so the reader must not busy-wait on it (which would starve the
|
|
200
|
-
// macrotask queue and never observe the next group).
|
|
201
|
-
const g0 = producer.appendGroup();
|
|
202
|
-
g0.close();
|
|
203
|
-
// The next group arrives via a macrotask; if the reader livelocks on microtasks it never runs.
|
|
204
|
-
setTimeout(() => {
|
|
205
|
-
const g1 = producer.appendGroup();
|
|
206
|
-
g1.writeString("hello");
|
|
207
|
-
g1.close();
|
|
208
|
-
producer.close();
|
|
209
|
-
}, 10);
|
|
210
|
-
expect(await track.readString()).toBe("hello");
|
|
211
|
-
}, 2000);
|
|
212
|
-
//# sourceMappingURL=track.test.js.map
|