summaryrefslogtreecommitdiff
path: root/lib/textui
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 21:12:41 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 22:42:08 -0700
commit5edd0d7be38595c4777d5130ca20f907d8a74963 (patch)
tree6abc0ad25c22bb6da565e0ca15cdfc97bd6427e7 /lib/textui
parent0df7a38046acf81b3e785526e7065775d058dd36 (diff)
lint: Turn on paralleltest
Diffstat (limited to 'lib/textui')
-rw-r--r--lib/textui/log_test.go5
-rw-r--r--lib/textui/text_test.go5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/textui/log_test.go b/lib/textui/log_test.go
index 08eb38c..514d96e 100644
--- a/lib/textui/log_test.go
+++ b/lib/textui/log_test.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -20,6 +20,7 @@ func logLineRegexp(inner string) string {
}
func TestLogFormat(t *testing.T) {
+ t.Parallel()
var out strings.Builder
ctx := dlog.WithLogger(context.Background(), textui.NewLogger(&out, dlog.LogLevelTrace))
dlog.Debugf(ctx, "foo %d", 12345)
@@ -29,6 +30,7 @@ func TestLogFormat(t *testing.T) {
}
func TestLogLevel(t *testing.T) {
+ t.Parallel()
var out strings.Builder
ctx := dlog.WithLogger(context.Background(), textui.NewLogger(&out, dlog.LogLevelInfo))
dlog.Error(ctx, "Error")
@@ -54,6 +56,7 @@ func TestLogLevel(t *testing.T) {
}
func TestLogField(t *testing.T) {
+ t.Parallel()
var out strings.Builder
ctx := dlog.WithLogger(context.Background(), textui.NewLogger(&out, dlog.LogLevelInfo))
ctx = dlog.WithField(ctx, "foo", 12345)
diff --git a/lib/textui/text_test.go b/lib/textui/text_test.go
index c4b42f6..4b93683 100644
--- a/lib/textui/text_test.go
+++ b/lib/textui/text_test.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -16,12 +16,14 @@ import (
)
func TestFprintf(t *testing.T) {
+ t.Parallel()
var out strings.Builder
textui.Fprintf(&out, "%d", 12345)
assert.Equal(t, "12,345", out.String())
}
func TestHumanized(t *testing.T) {
+ t.Parallel()
assert.Equal(t, "12,345", fmt.Sprint(textui.Humanized(12345)))
assert.Equal(t, "12,345 ", fmt.Sprintf("%-8d", textui.Humanized(12345)))
@@ -32,6 +34,7 @@ func TestHumanized(t *testing.T) {
}
func TestPortion(t *testing.T) {
+ t.Parallel()
assert.Equal(t, "100% (0/0)", fmt.Sprint(textui.Portion[int]{}))
assert.Equal(t, "0% (1/12,345)", fmt.Sprint(textui.Portion[int]{N: 1, D: 12345}))
assert.Equal(t, "100% (0/0)", fmt.Sprint(textui.Portion[btrfsvol.PhysicalAddr]{}))