mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-07 01:32:56 +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")
|
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
|
// test escape
|
||||||
p = CompilePattern("\\\\") // pattern: \\
|
p = CompilePattern("\\\\") // pattern: \\
|
||||||
if !p.IsMatch("\\") {
|
if !p.IsMatch("\\") {
|
||||||
|
Reference in New Issue
Block a user