mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 12:16:16 +08:00
18 lines
332 B
Go
18 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")
|
|
}
|
|
}
|