mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-06 17:26:52 +08:00
add more test case
This commit is contained in:
@@ -81,6 +81,18 @@ func TestWildCard(t *testing.T) {
|
||||
t.Error("expect false actually true")
|
||||
}
|
||||
|
||||
// test [^]
|
||||
p = CompilePattern("h[^ab]llo")
|
||||
if p.IsMatch("hallo") {
|
||||
t.Error("expect false actually true")
|
||||
}
|
||||
if p.IsMatch("hbllo") {
|
||||
t.Error("expect false actually true")
|
||||
}
|
||||
if !p.IsMatch("hcllo") {
|
||||
t.Error("expect true actually false")
|
||||
}
|
||||
|
||||
// test escape
|
||||
p = CompilePattern("\\\\") // pattern: \\
|
||||
if !p.IsMatch("\\") {
|
||||
|
Reference in New Issue
Block a user