aboutsummaryrefslogtreecommitdiff
path: root/lib/bytes/bytes_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bytes/bytes_test.go')
-rw-r--r--lib/bytes/bytes_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/bytes/bytes_test.go b/lib/bytes/bytes_test.go
index 2e1b3a24..5885eeb2 100644
--- a/lib/bytes/bytes_test.go
+++ b/lib/bytes/bytes_test.go
@@ -312,6 +312,22 @@ func TestTokenFind(t *testing.T) {
testTokenFind(t, line, token, 0, exp)
}
+func TestInReplace(t *testing.T) {
+ cases := []struct {
+ in string
+ exp string
+ }{{
+ in: "/a/path/to/file.ext",
+ exp: "_a_path_to_file_ext",
+ }}
+
+ for _, c := range cases {
+ got := InReplace([]byte(c.in), []byte(ASCIILettersNumber), '_')
+
+ test.Assert(t, "InReplace", c.exp, string(got), true)
+ }
+}
+
func BenchmarkToLowerStd(b *testing.B) {
randomInput256 := Random([]byte(HexaLetters), 256)