rogpeppe / go-internal

Selected Go-internal packages factored out from the standard library
BSD 3-Clause "New" or "Revised" License
825 stars 67 forks source link

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

Closed bitfield closed 1 year ago

bitfield commented 1 year ago

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.