Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed May 21, 2022
1 parent a35a7fa commit ff3cf4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 4 additions & 4 deletions encode_test.go
Expand Up @@ -48,7 +48,7 @@ var encodeTests = []struct {
EmailVerified: true,
Memo: "songmu.jp",
},
Output: "user:songmu\tage:36\tweight:66.6",
Output: "user:songmu\tage:36\tweight:66.6\temail_verified:true",
},
{
Name: "Simple without nil pointer",
Expand All @@ -60,7 +60,7 @@ var encodeTests = []struct {
EmailVerified: false,
Memo: "songmu.jp",
},
Output: "user:songmu\tage:36\theight:169.1\tweight:66.6",
Output: "user:songmu\tage:36\theight:169.1\tweight:66.6\temail_verified:false",
},
{
Name: "Omit memo",
Expand All @@ -69,7 +69,7 @@ var encodeTests = []struct {
Age: 36,
Memo: "songmu.jp",
},
Output: "user:songmu\tage:36\tweight:0",
Output: "user:songmu\tage:36\tweight:0\temail_verified:false",
},
{
Name: "Anthoer struct",
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestMarshal(t *testing.T) {
}
} else {
if s != tt.Output {
t.Errorf("%s: out=%s, want=%s", tt.Name, s, tt.Output)
t.Errorf("%s:\n out =%s\n want=%s", tt.Name, s, tt.Output)
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions example_test.go
@@ -1,7 +1,6 @@
package ltsv_test

import (
"fmt"
"net"
"time"

Expand Down Expand Up @@ -47,14 +46,10 @@ func ExampleUnmarshal() {
"vhost:mackerel.io"
l := log{}
ltsv.Unmarshal([]byte(ltsvLog), &l)
t := l.Time
l.Time = nil
fmt.Println(t)
pretty.Println(l)
// Output:
// 2016-07-13 00:00:04 +0900 +0900
// ltsv_test.log{
// Time: (*ltsv_test.logTime)(nil),
// Time: time.Date(2016, time.July, 13, 0, 0, 4, 0, time.Location("")),
// Host: {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xc0, 0x0, 0x2, 0x1},
// Req: "POST /api/v0/tsdb HTTP/1.1",
// Status: 200,
Expand Down

0 comments on commit ff3cf4f

Please sign in to comment.