MCPcopy
hub / github.com/harness/harness / TestCleanUpWhitespace

Function TestCleanUpWhitespace

git/parser/commit_message_test.go:19–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17import "testing"
18
19func TestCleanUpWhitespace(t *testing.T) {
20 tests := []struct {
21 name string
22 input string
23 exp string
24 }{
25 {
26 name: "remove_trailing_spaces_in_lines",
27 input: "" +
28 "ABC \n" +
29 "\t\t\n" +
30 "DEF\t\n",
31 exp: "" +
32 "ABC\n" +
33 "\n" +
34 "DEF\n",
35 },
36 {
37 name: "add_eof_to_the_last_line",
38 input: "" +
39 "ABC\n" +
40 "DEF",
41 exp: "" +
42 "ABC\n" +
43 "DEF\n",
44 },
45 {
46 name: "remove_consecutive_empty_lines",
47 input: "" +
48 "ABC\n" +
49 "\n" +
50 "\t\t\n" +
51 "\n" +
52 "DEF\n",
53 exp: "" +
54 "ABC\n" +
55 "\n" +
56 "DEF\n",
57 },
58 {
59 name: "remove_empty_lines_from_the_message_bottom",
60 input: "" +
61 "ABC\n" +
62 "\n" +
63 "DEF\n" +
64 "\n" +
65 "\n" +
66 "\n",
67 exp: "" +
68 "ABC\n" +
69 "\n" +
70 "DEF\n",
71 },
72 {
73 name: "remove_empty_lines_from_the_message_top",
74 input: "" +
75 "\n" +
76 "\n" +

Callers

nothing calls this directly

Calls 3

CleanUpWhitespaceFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…