mirror of https://github.com/dexidp/dex.git
Browse Source
Use the escape filter method provided by the upstream LDAP package instead of rolling our own.pull/701/head
2 changed files with 2 additions and 66 deletions
@ -1,23 +0,0 @@
|
||||
package ldap |
||||
|
||||
import "testing" |
||||
|
||||
func TestEscapeFilter(t *testing.T) { |
||||
tests := []struct { |
||||
val string |
||||
want string |
||||
}{ |
||||
{"Five*Star", "Five\\2aStar"}, |
||||
{"c:\\File", "c:\\5cFile"}, |
||||
{"John (2nd)", "John \\282nd\\29"}, |
||||
{string([]byte{0, 0, 0, 4}), "\\00\\00\\00\\04"}, |
||||
{"Chloé", "Chlo\\c3\\a9"}, |
||||
} |
||||
|
||||
for _, tc := range tests { |
||||
got := escapeFilter(tc.val) |
||||
if tc.want != got { |
||||
t.Errorf("value %q want=%q, got=%q", tc.val, tc.want, got) |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue