Personal Telegram developer console for GitHub
test: align Workspace policy coverage with Mini App limits
davoodmehraban89 committed
Oct 4, 2026 at 11:18 UTC
1de04a7bae0afc9915dc33189a23f008db7fe178
1 file changed
+10
-9
test/workspace-policy.test.js
+10
-9
@@ -41,28 +41,29 @@ test('editable file policy rejects sensitive paths binary markers LFS and both s
41
assert.equal(lfs.editable, false);
42
assert.match(lfs.reason, /LFS/i);
43
44
- const tooManyChars = validateEditableFile({ path: 'large.txt', text: 'a'.repeat(3001) });
44
+ const tooManyChars = validateEditableFile({ path: 'large.txt', text: 'a'.repeat(20001) });
45
assert.equal(tooManyChars.editable, false);
46
- assert.match(tooManyChars.reason, /3,000|3000/);
46
+ assert.match(tooManyChars.reason, /20,000|20000/);
47
48
- const explicitTooManyBytes = validateEditableFile({ path: 'large.txt', text: 'ok', byteLength: 12001 });
48
+ const explicitTooManyBytes = validateEditableFile({ path: 'large.txt', text: 'ok', byteLength: 65537 });
49
assert.equal(explicitTooManyBytes.editable, false);
50
- assert.match(explicitTooManyBytes.reason, /12,000|12000/);
50
+ assert.match(explicitTooManyBytes.reason, /65,536|65536/);
51
});
52
53
test('editable file policy enforces multibyte UTF-8 byte boundary independently from character boundary', () => {
54
const validateEditableFile = requireFn('validateEditableFile');
55
- const exact = '😀'.repeat(3000);
55
+ const exact = '😀'.repeat(16384);
56
const exactResult = validateEditableFile({ path: 'emoji.txt', text: exact });
57
- assert.equal(exactResult.charLength, 3000);
58
- assert.equal(exactResult.byteLength, 12000);
57
+ assert.equal(exactResult.charLength, 16384);
58
+ assert.equal(exactResult.byteLength, 65536);
59
assert.equal(exactResult.editable, true);
60
61
const over = `${exact}a`;
62
const overResult = validateEditableFile({ path: 'emoji.txt', text: over });
63
- assert.equal(overResult.charLength, 3001);
64
- assert.equal(overResult.byteLength, 12001);
63
+ assert.equal(overResult.charLength, 16385);
64
+ assert.equal(overResult.byteLength, 65537);
65
assert.equal(overResult.editable, false);
66
+ assert.match(overResult.reason, /65,536|65536/);
67
});
68
69
test('commit message and target branch normalization fail closed on empty or unsafe values', () => {