3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 06:35:44 +01:00

Answer architecture round 1: 0 🔴, 7 🟡 (0 misread); test BlockText's measures and the batching against one run per pass, one withinLongest, marker facts beside their readers

This commit is contained in:
2026-10-29 13:55:50 +01:00
committed by Lillem4n
parent 10cb24e706
commit 28ae354315
15 changed files with 201 additions and 85 deletions
+4 -3
View File
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
import test from 'node:test'
import type { Result } from './result.ts'
import { joinedWithin, withinEngineLimits, withinLongest } from './length-bound.ts'
import { joinedWithin, longestOutput, withinEngineLimits, withinLongest } from './length-bound.ts'
import { success } from './result.ts'
// The code at the document's path, and the bound the message names.
@@ -24,8 +24,9 @@ test('joins pieces up to the bound, and builds nothing past it', () => {
assert.equal(pastTheBound(joinedWithin([half, half])), true)
})
test('passes a text within the bound', () => {
assert.deepEqual(withinLongest('x'), success('x'))
test('passes a value whose length is within the bound, and refuses one past it', () => {
assert.deepEqual(withinLongest(longestOutput, 'x'), success('x'))
assert.equal(pastTheBound(withinLongest(longestOutput + 1, 'x')), true)
})
test('refuses a string past the bound as too long on every engine, and any other engine limit as engine-limit', () => {