git » log » commit 0a5133d

Adjust tests for the newly exported Level

author Alberto Bertogli
2017-09-10 11:00:02 UTC
committer Alberto Bertogli
2017-09-10 11:00:02 UTC
parent e82a58ba91bfadf84fe9aa726a7fd82f9e5319bf

Adjust tests for the newly exported Level

The last commit exported the Level field, but missed the updated tests.
Shame on me!  This omission is fixed by this patch.

log_test.go +5 -5

diff --git a/log_test.go b/log_test.go
index 28d9dc4..73a671b 100644
--- a/log_test.go
+++ b/log_test.go
@@ -57,7 +57,7 @@ func testLogger(t *testing.T, fname string, l *Logger) {
 	checkContentsMatch(t, "error", fname, `^E log_test.go:....   error 1\n`)
 
 	if l.V(Debug) {
-		t.Fatalf("Debug level enabled by default (level: %v)", l.level)
+		t.Fatalf("Debug level enabled by default (level: %v)", l.Level)
 	}
 
 	os.Truncate(fname, 0)
@@ -66,23 +66,23 @@ func testLogger(t *testing.T, fname string, l *Logger) {
 	checkContentsMatch(t, "debug-no-log", fname, `^$`)
 
 	os.Truncate(fname, 0)
-	l.level = Debug
+	l.Level = Debug
 	l.Debugf("debug %d", 1)
 	checkContentsMatch(t, "debug", fname, `^\. log_test.go:....   debug 1\n`)
 
 	if !l.V(Debug) {
-		t.Errorf("l.level = Debug, but V(Debug) = false")
+		t.Errorf("l.Level = Debug, but V(Debug) = false")
 	}
 
 	os.Truncate(fname, 0)
-	l.level = Info
+	l.Level = Info
 	l.Log(Debug, 0, "log debug %d", 1)
 	l.Log(Info, 0, "log info %d", 1)
 	checkContentsMatch(t, "log", fname,
 		`^_ log_test.go:....   log info 1\n`)
 
 	os.Truncate(fname, 0)
-	l.level = Info
+	l.Level = Info
 	l.Log(Fatal, 0, "log fatal %d", 1)
 	checkContentsMatch(t, "log", fname,
 		`^☠ log_test.go:....   log fatal 1\n`)