Refactor architecture into eight components and consolidate reliability work
Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
This commit is contained in:
1 parent
9dd425f765
commit
d5d21b7841
302 files changed
+20037
-3492
No files matched your search
@@ -0,0 +1,26 @@
|
||||
const {test} = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const {destination, resolvePath} = require('../../../static/js/browser-address.js');
|
||||
|
||||
test('absolute, relative and virtual paths use the browser route', () => {
|
||||
assert.equal(destination('/docs/new').href, '/v/browser/docs/new');
|
||||
assert.equal(destination('child', '/docs').href, '/v/browser/docs/child');
|
||||
assert.equal(destination('cd ../new', '/docs/old').path, '/docs/new');
|
||||
assert.equal(destination('cd', '/docs').path, '/');
|
||||
assert.equal(destination('cd ../../../../', '/docs').path, '/');
|
||||
assert.equal(destination('./a//b/./c/..', '/docs').path, '/docs/a/b');
|
||||
});
|
||||
test('editor and viewer commands preserve names and avoid adapter-route ambiguity', () => {
|
||||
assert.equal(destination('vi plain/example', '/').href, '/e/-/plain/example');
|
||||
assert.equal(destination('view', '/docs/page').href, '/docs/page');
|
||||
assert.equal(destination('vi file name', '/docs').href, '/e/-/docs/file%20name');
|
||||
assert.equal(destination('vi 日記 #1?%25', '/docs').href, '/e/-/docs/%E6%97%A5%E8%A8%98%20%231%3F%2525');
|
||||
assert.equal(destination('/cd', '/docs').path, '/cd');
|
||||
assert.equal(destination('view a;rm -rf', '/').href, '/a%3Brm%20-rf');
|
||||
});
|
||||
test('schemes, network paths and controls are not accepted', () => {
|
||||
for (const value of ['https://outside.test', '//outside.test', 'javascript:alert(1)', 'file:///etc/passwd', 'a\\b', '/a\n/b', '/a\u0000b']) {
|
||||
assert.throws(() => resolvePath(value), /invalid_path/);
|
||||
}
|
||||
assert.equal(destination('view /%2f%2fevil.test').href, '/%252f%252fevil.test');
|
||||
});
|
||||
Reference in new issue
Block a user