MCPcopy
hub / github.com/cli/cli / TestRemoveExcessiveWhitespace

Function TestRemoveExcessiveWhitespace

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

Source from the content-addressed store, hash-verified

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