Fix tests to pass on linux

This commit is contained in:
bel
2020-03-13 03:40:53 +00:00
parent 6d39ef9aa2
commit 0d6be1e9d8
6 changed files with 185 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package logger
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"local/logb"
"os"
@@ -29,8 +30,8 @@ func TestInterface(t *testing.T) {
os.Stderr = was
}()
logger.Info("hello from %v", "me")
logger.Error(errors.New("bad"), "error from %v", "me")
logger.Info(fmt.Sprintf("hello from %v", "me"))
logger.Error(errors.New("bad"), fmt.Sprintf("error from %v", "me"))
if !bytes.Contains(w.Bytes(), []byte(`error from me`)) {
t.Errorf("%s", w.Bytes())