Skip to content

Commit

Permalink
compare tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Mar 15, 2024
1 parent 29674c6 commit e26a801
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/testTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class TestTree extends DisposableBase {
vsChildrenById.set(id, vsChild);
vsChildren.add(vsChild);
}
if (uChild.kind === 'case')
if (uChild.kind === 'case' && !areEqualTags(uChild.tags, vsChild.tags))
vsChild.tags = uChild.tags.map(tag => new this._vscode.TestTag(tag));
const hasLocation = uChild.location.line || uChild.location.column;
if (hasLocation && (!vsChild.range || vsChild.range.start.line + 1 !== uChild.location.line)) {
Expand Down Expand Up @@ -215,4 +215,15 @@ export class TestTree extends DisposableBase {
}
}

function areEqualTags(uTags: readonly string[], vsTags: readonly vscodeTypes.TestTag[]): boolean {
if (uTags.length !== vsTags.length)
return false;
const uTagsSet = new Set(uTags);
for (const tag of vsTags) {
if (!uTagsSet.has(tag.id))
return false;
}
return true;
}

const testIdSymbol = Symbol('testId');

0 comments on commit e26a801

Please sign in to comment.