From 5edd0d7be38595c4777d5130ca20f907d8a74963 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 1 Jan 2023 21:12:41 -0700 Subject: lint: Turn on paralleltest --- lib/textui/log_test.go | 5 ++++- lib/textui/text_test.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/textui') 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 +// Copyright (C) 2022-2023 Luke Shumaker // // 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 +// Copyright (C) 2022-2023 Luke Shumaker // // 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]{})) -- cgit v1.2.3-2-g168b