Skip to content

Commit fa6a31e

Browse files
committed
testscript: add TestScript.Name
This will be useful in some cmd/cue test scripts where we want each test to create a unique remote resource that includes the current test name as a prefix, for the sake of more easily seeing which test created which resource.
1 parent 0bcf77f commit fa6a31e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

testscript/testscript.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ func writeFile(name string, data []byte, perm fs.FileMode, excl bool) error {
413413
return nil
414414
}
415415

416+
// Name returns the short name or basename of the test script.
417+
func (ts *TestScript) Name() string { return ts.name }
418+
416419
// setup sets up the test execution temporary directory and environment.
417420
// It returns the comment section of the txtar archive.
418421
func (ts *TestScript) setup() string {

0 commit comments

Comments
 (0)