mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-23 18:55:49 +03:00
17 lines
332 B
Go
17 lines
332 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
// This works because it does not have the same signature as the
|
|
// conventional "TestMain" function described in the testing package
|
|
// godoc.
|
|
func TestMain(t *testing.T) {
|
|
var ran bool
|
|
run = func() {
|
|
ran = true
|
|
}
|
|
main()
|
|
if !ran {
|
|
t.Error("Expected Run() to be called, but it wasn't")
|
|
}
|
|
}
|