From f5207d775d230d1a25689c84a5c149c82ed1b716 Mon Sep 17 00:00:00 2001 From: Craig Gower-Page Date: Sat, 7 Oct 2023 06:28:55 +0100 Subject: [PATCH] Add task to test current file (#1415) --- package.json | 2 +- src/tasks.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 630e59bd1..6c0c91d88 100644 --- a/package.json +++ b/package.json @@ -2086,7 +2086,7 @@ ], "pattern": [ { - "regexp": "^(Failure|Error)\\s\\((.*\\.[Rr]):(\\d+):?(\\d+)?\\):\\s(.*)", + "regexp": "^[-─ ]*(Failure|Error)\\s\\((.*\\.[Rr]):(\\d+):?(\\d+)?\\):\\s(.*)", "file": 2, "line": 3, "column": 4, diff --git a/src/tasks.ts b/src/tasks.ts index fdb939139..1062ee438 100644 --- a/src/tasks.ts +++ b/src/tasks.ts @@ -45,6 +45,16 @@ const rtasks: RTaskInfo[] = [ problemMatchers: '$testthat' }, + { + definition: { + type: TYPE, + code: ['testthat::test_file("${file}")'] + }, + name: 'Test (Current File)', + group: vscode.TaskGroup.Test, + problemMatchers: '$testthat' + }, + { definition: { type: TYPE,