diff options
author | Ryan Boehning <ryanboehning@gmail.com> | 2018-02-17 14:01:06 -0800 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2018-03-13 14:56:55 +0900 |
commit | 21b94d2de5bdf2d8c4e8107e4c197a2abc1e7275 (patch) | |
tree | d7255fcd66e512a40016ac220d84574f22c0d551 /src/options_test.go | |
parent | 24236860c89242ac0a341ff911c93f25032dc051 (diff) |
Make fzf pass go vet
Add String() methods to types, so they can be printed with %s. Change
some %s format specifiers to %v, when the default string representation
is good enough. In Go 1.10, `go test` triggers a parallel `go vet`. So
this also makes fzf pass `go test`.
Close #1236
Close #1219
Diffstat (limited to 'src/options_test.go')
-rw-r--r-- | src/options_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/options_test.go b/src/options_test.go index 22f4e4ee..543bf570 100644 --- a/src/options_test.go +++ b/src/options_test.go @@ -50,7 +50,7 @@ func TestDelimiterRegexString(t *testing.T) { tokens[2].text.ToString() != "---*" || tokens[3].text.ToString() != "*" || tokens[4].text.ToString() != "---" { - t.Errorf("%s %s %d", delim, tokens, len(tokens)) + t.Errorf("%s %v %d", delim, tokens, len(tokens)) } } @@ -71,7 +71,7 @@ func TestSplitNth(t *testing.T) { if len(ranges) != 1 || ranges[0].begin != rangeEllipsis || ranges[0].end != rangeEllipsis { - t.Errorf("%s", ranges) + t.Errorf("%v", ranges) } } { @@ -87,7 +87,7 @@ func TestSplitNth(t *testing.T) { ranges[7].begin != -2 || ranges[7].end != -2 || ranges[8].begin != 2 || ranges[8].end != -2 || ranges[9].begin != rangeEllipsis || ranges[9].end != rangeEllipsis { - t.Errorf("%s", ranges) + t.Errorf("%v", ranges) } } } @@ -99,7 +99,7 @@ func TestIrrelevantNth(t *testing.T) { parseOptions(opts, words) postProcessOptions(opts) if len(opts.Nth) != 0 { - t.Errorf("nth should be empty: %s", opts.Nth) + t.Errorf("nth should be empty: %v", opts.Nth) } } for _, words := range [][]string{[]string{"--nth", "..,3", "+x"}, []string{"--nth", "3,1..", "+x"}, []string{"--nth", "..-1,1", "+x"}} { @@ -108,7 +108,7 @@ func TestIrrelevantNth(t *testing.T) { parseOptions(opts, words) postProcessOptions(opts) if len(opts.Nth) != 0 { - t.Errorf("nth should be empty: %s", opts.Nth) + t.Errorf("nth should be empty: %v", opts.Nth) } } { @@ -117,7 +117,7 @@ func TestIrrelevantNth(t *testing.T) { parseOptions(opts, words) postProcessOptions(opts) if len(opts.Nth) != 2 { - t.Errorf("nth should not be empty: %s", opts.Nth) + t.Errorf("nth should not be empty: %v", opts.Nth) } } } |