// FailNow ends the run: Moxie has no recover, so a fatal test cannot unwind // just its own body. This fixture must exit non-zero and say why. package main import "testing" func TestFatalEndsTheRun(t *testing.T) { t.Fatal("fatal worked") println("unreachable after Fatal") } func TestNeverRuns(t *testing.T) { println("should-not-print") } func main() { // Termination: a batch program must still be stoppable, so the entry // handles the channel the runtime closes on SIGINT/SIGTERM. select { case <-shutdown: return default: } testing.Main([]testing.InternalTest{ {Name: "TestFatalEndsTheRun", F: TestFatalEndsTheRun}, {Name: "TestNeverRuns", F: TestNeverRuns}, }) }