Skip to content

Commit

Permalink
chore(developer): correct ERROR_OutsTooLong test following fix #11137
Browse files Browse the repository at this point in the history
  • Loading branch information
markcsinclair committed Apr 22, 2024
1 parent 1d7849b commit 5ec3589
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ group(main) using keys

c maximum store length is 4096 UTF-16 code units, including U+0000 terminator
c #define GLOBAL_BUFSIZE 4096 // compfile.h
c so we need 0x101C - 0x0020 + 1 = 0x0FFD --> 4093 words
c + 1, for 'a' in the rule below = 4094, which triggers the buffer boundary check.
c so we need 0x101D - 0x0020 + 1 = 0x0FFE --> 4094 words
c + 1, for 'a' in the rule below = 4095, which triggers the buffer boundary check.
c Noting that this is conservative and losing 2 possible chars, but not fixing
c in compiler.cpp at this time.
c See #11136 for calculation adjustment TODO

store(x) U+0020 .. U+101C
store(x) U+0020 .. U+101D

'a' outs(x) + 'x' > 'x' context
4 changes: 2 additions & 2 deletions developer/src/kmc-kmn/test/test-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ describe('KmnCompilerMessages', function () {

// ERROR_OutsTooLong

it('should generate ERROR_OutsTooLong if a store referenced in outs() is too long (more than GLOBAL_BUFSIZE elements)', async function() {
it('should generate ERROR_OutsTooLong if a store referenced in outs() is too long and would overflow the buffer', async function() {
await testForMessage(this, ['invalid-keyboards', 'error_outs_too_long.kmn'], KmnCompilerMessages.ERROR_OutsTooLong);
// callbacks.printMessages();
assert.equal(callbacks.messages[0].message, "Store cannot be inserted with outs() as it makes the extended string too long character offset: 5");
});

// ERROR_ExtendedStringTooLong
Expand Down

0 comments on commit 5ec3589

Please sign in to comment.