Move extendedAttributes function to TestUtils so it can be used by InputHandler.test.ts.

This is a followup to pull request #5748.
It removes the remaining test uses of internal _extendedAttrs.
This commit is contained in:
Per Bothner
2026-03-22 20:53:13 -07:00
parent 1432e20082
commit 2d9b21f5c7
3 changed files with 16 additions and 16 deletions
+6 -6
View File
@@ -11,7 +11,7 @@ import { CellData } from 'common/buffer/CellData';
import { Attributes, BgFlags, UnderlineStyle } from 'common/buffer/Constants';
import { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';
import { Params } from 'common/parser/Params';
import { MockCoreService, MockBufferService, MockOptionsService, MockLogService, MockMouseStateService, MockCharsetService, MockUnicodeService, MockOscLinkService } from 'common/TestUtils.test';
import { MockCoreService, MockBufferService, MockOptionsService, MockLogService, MockMouseStateService, MockCharsetService, MockUnicodeService, MockOscLinkService, extendedAttributes } from 'common/TestUtils.test';
import { IBufferService, ICoreService, type IOscLinkService } from 'common/services/Services';
import { DEFAULT_OPTIONS } from 'common/services/OptionsService';
import { clone } from 'common/Clone';
@@ -2002,15 +2002,15 @@ describe('InputHandler', () => {
// eAttrs in buffer pos 0 and 1 should be the same object
assert.equal(
(bufferService.buffer!.lines.get(0)! as any)._extendedAttrs[0],
(bufferService.buffer!.lines.get(0)! as any)._extendedAttrs[1]
extendedAttributes(bufferService.buffer!.lines.get(0)!, 0),
extendedAttributes(bufferService.buffer!.lines.get(0)!, 1)
);
// should not have written eAttr for pos 2 in the buffer
assert.equal((bufferService.buffer!.lines.get(0)! as any)._extendedAttrs[2], undefined);
assert.equal(extendedAttributes(bufferService.buffer!.lines.get(0)!, 2), undefined);
// eAttrs in buffer pos 1 and pos 3 must be different objs
assert.notEqual(
(bufferService.buffer!.lines.get(0)! as any)._extendedAttrs[1],
(bufferService.buffer!.lines.get(0)! as any)._extendedAttrs[3]
extendedAttributes(bufferService.buffer!.lines.get(0)!, 1),
extendedAttributes(bufferService.buffer!.lines.get(0)!, 3)
);
});
});