cli/debug: use string-literals for easier grep'ing

Also removed some newlines from t.Fatal() as they shouldn't be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-05 12:13:53 +02:00
parent 02815416bb
commit c3d533f37f
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -14,20 +14,20 @@ func TestEnable(t *testing.T) {
}() }()
Enable() Enable()
if os.Getenv("DEBUG") != "1" { if os.Getenv("DEBUG") != "1" {
t.Fatalf("expected DEBUG=1, got %s\n", os.Getenv("DEBUG")) t.Fatalf("expected DEBUG=1, got %s", os.Getenv("DEBUG"))
} }
if logrus.GetLevel() != logrus.DebugLevel { if logrus.GetLevel() != logrus.DebugLevel {
t.Fatalf("expected log level %v, got %v\n", logrus.DebugLevel, logrus.GetLevel()) t.Fatalf("expected log level %v, got %v", logrus.DebugLevel, logrus.GetLevel())
} }
} }
func TestDisable(t *testing.T) { func TestDisable(t *testing.T) {
Disable() Disable()
if os.Getenv("DEBUG") != "" { if os.Getenv("DEBUG") != "" {
t.Fatalf("expected DEBUG=\"\", got %s\n", os.Getenv("DEBUG")) t.Fatalf(`expected DEBUG="", got %s`, os.Getenv("DEBUG"))
} }
if logrus.GetLevel() != logrus.InfoLevel { if logrus.GetLevel() != logrus.InfoLevel {
t.Fatalf("expected log level %v, got %v\n", logrus.InfoLevel, logrus.GetLevel()) t.Fatalf("expected log level %v, got %v", logrus.InfoLevel, logrus.GetLevel())
} }
} }