Skip to content

testscript: trim '.txtar' extension from subtest name#179

Merged
mvdan merged 1 commit intorogpeppe:masterfrom
bitfield:trim_txtar
Aug 20, 2022
Merged

testscript: trim '.txtar' extension from subtest name#179
mvdan merged 1 commit intorogpeppe:masterfrom
bitfield:trim_txtar

Conversation

@bitfield
Copy link
Copy Markdown
Contributor

I noticed that, while the .txt extension is stripped from the script filename when constructing the subtest name passed to t.Run, the same is not done for scripts with a .txtar extension. This commit strips .txtar too.

Rather than add an explicit test for this, I changed the name of one of the existing test scripts from .txt to .txtar, so that the tests would fail unless the extension is correctly stripped.

@bitfield bitfield changed the title Trim '.txtar' extension from subtest name testscript: trim '.txtar' extension from subtest name Aug 20, 2022
Copy link
Copy Markdown
Collaborator

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely spotted; I must have missed this when I added support for txtar filename extensions.

@mvdan mvdan merged commit 57a71e0 into rogpeppe:master Aug 20, 2022
@bitfield bitfield deleted the trim_txtar branch August 20, 2022 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants