The block, rewritten the way a well-behaved model would rewrite it.
(document: PseudocodeDocument)
| 19 | |
| 20 | /** The block, rewritten the way a well-behaved model would rewrite it. */ |
| 21 | function goodRewrite(document: PseudocodeDocument): string { |
| 22 | return document.lines |
| 23 | .map((line) => (line.order === undefined ? `${line.text} (rephrased)` : `${line.order}. rephrased ${line.text.replace(/^\d+\.\s*/, '')}`)) |
| 24 | .join('\n'); |
| 25 | } |
| 26 | |
| 27 | describe('a rewrite that keeps the promise', () => { |
| 28 | it('is applied, line for line', () => { |