Continuing our series on the testscript package, we look at some advanced techniques in test scripts such as conditions, concurrency, and managing environment variables.
All tagged script
Continuing our series on the testscript package, we look at some advanced techniques in test scripts such as conditions, concurrency, and managing environment variables.
The txtar format is an ingenious way to supply arbitrary files and folder structures to test scripts. We’ll also learn about file management, simulating standard input, and breaking up scripts into phases.
The testscript package gives us an easy way to test the behaviour of a Go CLI tool, by executing it as an independent binary. Let’s see how.
Wouldn’t it be great if we could write tests for our Go CLI tools that are simple as shell scripts? The testscript package lets us do exactly that. Let’s take it for a spin.
The Unix shell is pure wizardry. Why shouldn’t it be as easy to write systems programs in Go as it is in the shell? The script library is the secret spell-book that makes this possible.