From df4e6715cf31817878d73286d2d4b1ea1b7afdbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20F=C3=A4rber?= <01mf02@gmail.com> Date: Fri, 20 Dec 2024 10:48:17 +0100 Subject: HTML tests (#5594) Co-authored-by: Laurenz --- tools/test-helper/README.md | 4 ++-- tools/test-helper/package.json | 3 +-- tools/test-helper/src/extension.ts | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'tools/test-helper') diff --git a/tools/test-helper/README.md b/tools/test-helper/README.md index 6eab6abd..3ecc1d4f 100644 --- a/tools/test-helper/README.md +++ b/tools/test-helper/README.md @@ -6,7 +6,7 @@ Code Lens buttons will appear above every test's name: - View: Opens the output and reference image of a test to the side. - Run: Runs the test and shows the results to the side. -- Save: Runs the test with `--update` to save the reference image. +- Save: Runs the test with `--update` to save the reference output. - Terminal: Runs the test in the integrated terminal. In the side panel opened by the Code Lens buttons, there are a few menu buttons @@ -14,7 +14,7 @@ at the top right: - Refresh: Reloads the panel to reflect changes to the images. - Run: Runs the test and shows the results. -- Save: Runs the test with `--update` to save the reference image. +- Save: Runs the test with `--update` to save the reference output. ## Installation In order for VS Code to run the extension with its built-in diff --git a/tools/test-helper/package.json b/tools/test-helper/package.json index de919ef3..d34213fb 100644 --- a/tools/test-helper/package.json +++ b/tools/test-helper/package.json @@ -28,7 +28,7 @@ }, { "command": "typst-test-helper.saveFromPreview", - "title": "Run and save reference image", + "title": "Run and save reference output", "category": "Typst Test Helper", "icon": "$(save)", "enablement": "typst-test-helper.runButtonEnabled" @@ -102,4 +102,3 @@ "vscode": "^1.88.0" } } - diff --git a/tools/test-helper/src/extension.ts b/tools/test-helper/src/extension.ts index 1f2cbd26..2e2b7d21 100644 --- a/tools/test-helper/src/extension.ts +++ b/tools/test-helper/src/extension.ts @@ -121,7 +121,7 @@ class TestHelper { const lenses = []; for (let nr = 0; nr < document.lineCount; nr++) { const line = document.lineAt(nr); - const re = /^--- ([\d\w-]+) ---$/; + const re = /^--- ([\d\w-]+)( [\d\w-]+)* ---$/; const m = line.text.match(re); if (!m) { continue; @@ -143,7 +143,7 @@ class TestHelper { }), new vscode.CodeLens(line.range, { title: "Save", - tooltip: "Run and view the test and save the reference image", + tooltip: "Run and view the test and save the reference output", command: "typst-test-helper.saveFromLens", arguments: [name], }), -- cgit v1.2.3