chore: use strings.ReplaceAll (#3801)

This commit is contained in:
Zhizhen He
2024-05-18 16:06:33 +08:00
committed by GitHub
parent 0994d9c881
commit 01e7668915
6 changed files with 13 additions and 13 deletions

View File

@@ -342,8 +342,8 @@ func TestAnsiCodeStringConversion(t *testing.T) {
state := interpretCode(code, prevState)
if expected != state.ToString() {
t.Errorf("expected: %s, actual: %s",
strings.Replace(expected, "\x1b[", "\\x1b[", -1),
strings.Replace(state.ToString(), "\x1b[", "\\x1b[", -1))
strings.ReplaceAll(expected, "\x1b[", "\\x1b["),
strings.ReplaceAll(state.ToString(), "\x1b[", "\\x1b["))
}
}
assert("\x1b[m", nil, "")