Skip to content

Commit

Permalink
testing: update content provider
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Aug 11, 2021
1 parent fa8ccff commit 45a9cfb
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ITextModel } from 'vs/editor/common/model';
import { IModelService } from 'vs/editor/common/services/modelService';
import { ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { TestMessageType } from 'vs/workbench/contrib/testing/common/testCollection';
import { parseTestUri, TestUriType, TEST_DATA_SCHEME } from 'vs/workbench/contrib/testing/common/testingUri';
import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService';

Expand Down Expand Up @@ -46,12 +47,16 @@ export class TestingContentProvider implements IWorkbenchContribution, ITextMode

let text: string | undefined;
switch (parsed.type) {
case TestUriType.ResultActualOutput:
text = test.tasks[parsed.taskIndex].messages[parsed.messageIndex]?.actualOutput;
case TestUriType.ResultActualOutput: {
const message = test.tasks[parsed.taskIndex].messages[parsed.messageIndex];
if (message?.type === TestMessageType.Error) { text = message.actual; }
break;
case TestUriType.ResultExpectedOutput:
text = test.tasks[parsed.taskIndex].messages[parsed.messageIndex]?.expectedOutput;
}
case TestUriType.ResultExpectedOutput: {
const message = test.tasks[parsed.taskIndex].messages[parsed.messageIndex];
if (message?.type === TestMessageType.Error) { text = message.expected; }
break;
}
case TestUriType.ResultMessage:
text = test.tasks[parsed.taskIndex].messages[parsed.messageIndex]?.message.toString();
break;
Expand Down

0 comments on commit 45a9cfb

Please sign in to comment.