Fit every concatenated segment in an SMS, and close the encoding helpers' throw (#96)

* Regression tests for the concatenated segment budget and the encoding-name door

* Budget unpacked segments at 134 octets, and export isEncodingName

* Name the length a Latin-1 message starts costing more segments at

* Fold the totality clause into hard rule 1, and log the unrepresentable-alphabet finding

* Make the maxSegments regression discriminate, and drop the narrating comments

* State the per-alphabet capacities accurately, and log the invalid-date path
This commit is contained in:
2026-09-09 17:21:51 +02:00
committed by GitHub
parent ff6ba9f825
commit 7d6039796d
7 changed files with 131 additions and 30 deletions
+11
View File
@@ -428,6 +428,17 @@ describe('sendSms()', () => {
assert.equal(sent.err, undefined);
assert.equal(attempts.length, 4);
const latin1 = 'å'.repeat(153 * 3);
const overLatin1 = await submitSms(deps, { encoding: 'LATIN1', from: '46701113311', maxSegments: 3, message: latin1, to: '46709771337' });
assert.ok(overLatin1.err instanceof Error);
assert.equal(attempts.length, 4);
const sentLatin1 = await submitSms(deps, { encoding: 'LATIN1', from: '46701113311', maxSegments: 4, message: latin1, to: '46709771337' });
assert.equal(sentLatin1.err, undefined);
assert.equal(attempts.length, 8);
});
});