You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: log_test.go
    path of file: ./repos/asynq/internal/log
    
    the code of the file until where you have to start completion: // Copyright 2020 Kentaro Hibino. All rights reserved.
// Use of this source code is governed by a MIT license
// that can be found in the LICENSE file.

package log

import (
	"bytes"
	"fmt"
	"regexp"
	"testing"
)

// regexp for timestamps
const (
	rgxPID          = `[0-9]+`
	rgxdate         = `[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]`
	rgxtime         = `[0-9][0-9]:[0-9][0-9]:[0-9][0-9]`
	rgxmicroseconds = `\.[0-9][0-9][0-9][0-9][0-9][0-9]`
)

type tester struct {
	desc        string
	message     string
	wantPattern string // regexp that log output must
    
func TestLoggerWarn(t *testing.T) {
	tests := []tester{
		{
			desc:    "without trailing newline, logger adds newline",
			message: "hello, world!",
			wantPattern: fmt.Sprintf("^asynq: pid=%s %s %s%s WARN: hello, world!\n$",
				rgxPID, rgxdate, rgxtime, rgxmicroseconds),
		},
		{
			desc:    "with trailing newline, logger preserves newline",
			message: "hello, world!\n",
			wantPattern: fmt.Sprintf("^asynq: pid=%s %s %s%s WARN: hello, world!\n$",
				rgxPID, rgxdate, rgxtime, rgxmicroseconds),
		},
	}

	for _, tc := range tests {
		var buf bytes.Buffer
		logger := NewLogger(newBase(&buf))

		logger.Warn(tc.message)

		got := buf.String()
		matched, err := regexp.MatchString(tc.wantPattern, got)
		if err != nil {
			t.Fatal("pattern did not compile:", err)
		}
		if !matched {
			t.Errorf("logger.Warn(%q) outputted %q, should match pattern %q",
				tc.message, got, tc.wantPattern)
		}
	}
}