go-github-selfupdate/selfupdate/log_test.go

31 lines
461 B
Go
Raw Normal View History

2017-12-26 02:45:08 +00:00
package selfupdate
import (
"testing"
)
func TestEnableDisableLog(t *testing.T) {
2017-12-30 04:25:42 +00:00
defer DisableLog()
2017-12-26 02:45:08 +00:00
EnableLog()
if !logEnabled {
t.Fatal("Log should be enabled")
}
EnableLog()
if !logEnabled {
t.Fatal("Log should be enabled")
}
DisableLog()
if logEnabled {
t.Fatal("Log should not be enabled")
}
DisableLog()
if logEnabled {
t.Fatal("Log should not be enabled")
}
EnableLog()
if !logEnabled {
t.Fatal("Log should be enabled")
}
}