MCPcopy Create free account
hub / github.com/cli/cli / TestRemoveExcessiveWhitespace

Function TestRemoveExcessiveWhitespace

internal/text/text_test.go:12–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestRemoveExcessiveWhitespace(t *testing.T) {
13 tests := []struct {
14 name string
15 input string
16 want string
17 }{
18 {
19 name: "nothing to remove",
20 input: "one two three",
21 want: "one two three",
22 },
23 {
24 name: "whitespace b-gone",
25 input: "\n one\n\t two three\r\n ",
26 want: "one two three",
27 },
28 }
29 for _, tt := range tests {
30 t.Run(tt.name, func(t *testing.T) {
31 got := RemoveExcessiveWhitespace(tt.input)
32 assert.Equal(t, tt.want, got)
33 })
34 }
35}
36
37func TestFuzzyAgoAbbr(t *testing.T) {
38 const form = "2006-Jan-02 15:04:05"

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected