@@ -70,6 +70,17 @@ test('complete watch idle is reset by bump', async () => {
|
||||
w.clear();
|
||||
});
|
||||
|
||||
test('repeat-loop stops a cloned spoken tail and keeps one copy', () => {
|
||||
const repeatLoop = require('../vendor/agent-harness/lib/repeat-loop.js');
|
||||
const unit = 'The public address is 203 0 113 8. ';
|
||||
const looping = unit.repeat(6);
|
||||
assert.equal(repeatLoop.isRepeating('Short answer.'), false);
|
||||
assert.equal(repeatLoop.isRepeating(looping), true);
|
||||
const collapsed = repeatLoop.collapseRepeats(looping);
|
||||
assert.ok(collapsed.startsWith('The public address is 203 0 113 8.'));
|
||||
assert.ok(collapsed.length < looping.length / 2);
|
||||
});
|
||||
|
||||
test('html pages are stripped to text for web_fetch', () => {
|
||||
const text = tools.htmlToText('<!DOCTYPE html><html><head><title>Hi</title></head><body><p>Honey peer</p></body></html>');
|
||||
assert.match(text, /Honey peer/);
|
||||
|
||||
Reference in New Issue
Block a user