Skip to content

Commit

Permalink
Update string format of report values
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfish-shogi committed Oct 28, 2021
1 parent 387da21 commit 4e882d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions adapters/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ func TestFileReportLogger(t *testing.T) {
b, err := ioutil.ReadAll(f)
require.NoError(t, err)
assert.Equal(t, "WARNING: Summary info=1 warn=1 error=0\n"+
"WARNING: r2: Report 2: int=[2] string=[bar]\n"+
"INFO: r1: Report 1: int=[1] string=[foo]\n", string(b))
"WARNING: r2: Report 2: int=2 string=bar\n"+
"INFO: r1: Report 1: int=1 string=foo\n", string(b))
}
2 changes: 1 addition & 1 deletion core/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (values Values) String() string {
if buf.Len() != 0 {
buf.WriteString(" ")
}
fmt.Fprintf(buf, "%s=[%v]", key, values[key])
fmt.Fprintf(buf, "%s=%v", key, values[key])
}
return string(buf.Bytes())
}
Expand Down
2 changes: 1 addition & 1 deletion core/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestValues(t *testing.T) {
"array": []string{"foo", "bar"},
}
assert.Equal(t, []string{"array", "int", "string"}, values.Keys())
assert.Equal(t, "array=[[foo bar]] int=[123] string=[abc]", values.String())
assert.Equal(t, "array=[foo bar] int=123 string=abc", values.String())
}

func TestReport(t *testing.T) {
Expand Down

0 comments on commit 4e882d6

Please sign in to comment.