Skip to content

Commit 35d9e92

Browse files
authored
Merge pull request #3 from acmcodercom/tab
why I miss tab?
2 parents 0f99068 + d686dcd commit 35d9e92

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

testdata/step.judger/datav6.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FirstName LastName City State
2+
Jim Wang LA California
3+
Musk Li Houston Texas

testdata/step.judger/userv6.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FirstName LastName City State
2+
Jim Wang LA California
3+
Musk Li Houston Texas

tool/differ.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
// clearString replace all white chars
1010
func clearString(str string) string {
1111
trimStr := strings.ReplaceAll(str, " ", "")
12+
trimStr = strings.ReplaceAll(trimStr, "\t", "")
1213
trimStr = strings.ReplaceAll(trimStr, "\n", "")
1314
trimStr = strings.ReplaceAll(trimStr, "\r", "")
1415
return trimStr

tool/differ_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ func TestDiffOutFunc(t *testing.T) {
9999
strictMode: true,
100100
shouldSame: false,
101101
},
102+
{
103+
desc: "(L)Compare tab and white characters",
104+
userOut: "userv6.out",
105+
dataOut: "datav6.out",
106+
ignoreHead: true,
107+
strictMode: false,
108+
shouldSame: true,
109+
},
102110
}
103111
for idx, tc := range tests {
104112
t.Logf("%d. %s:\n", idx+1, tc.desc)

0 commit comments

Comments
 (0)