hypnotranz 1a0419dc0c feat: initial Matrix SDK
Full SDK workspace: core, contracts, sdk, cli, browser-host, browser-kit,
federation, omega-core, oracle, self-healing, strategies, tools, emacs.
Clean extraction from the development monorepo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 15:54:15 -06:00

18 lines
546 B
TypeScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { mxesc1Encode, mxesc1Decode } from '@open-matrix/federation/mxesc1';
test('mxesc1 roundtrip: ascii + unicode + spaces', () => {
const samples = ['hello', 'hello world', 'über', 'foo', 'a/b.c-d_e~'];
for (const s of samples) {
const enc = mxesc1Encode(s);
const dec = mxesc1Decode(enc);
assert.equal(dec, s);
}
});
test('mxesc1 encodes unsafe chars', () => {
assert.equal(mxesc1Encode(' '), '%20');
assert.equal(mxesc1Encode('#'), '%23');
});