mirror of
https://github.com/adnanh/webhook.git
synced 2025-07-05 02:38:31 +00:00
Add IsNull and Exists types to the Match rule
This commit is contained in:
parent
6184509494
commit
d97d94537a
2 changed files with 34 additions and 27 deletions
|
@ -245,7 +245,7 @@ var extractParameterTests = []struct {
|
|||
|
||||
func TestExtractParameter(t *testing.T) {
|
||||
for _, tt := range extractParameterTests {
|
||||
value, err := ExtractParameterAsString(tt.s, tt.params)
|
||||
value, _, err := ExtractParameterAsString(tt.s, tt.params)
|
||||
if (err == nil) != tt.ok || value != tt.value {
|
||||
t.Errorf("failed to extract parameter %q:\nexpected {value:%#v, ok:%#v},\ngot {value:%#v, err:%v}", tt.s, tt.value, tt.ok, value, err)
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ func TestArgumentGet(t *testing.T) {
|
|||
Payload: tt.payload,
|
||||
RawRequest: tt.request,
|
||||
}
|
||||
value, err := a.Get(r)
|
||||
value, _, err := a.Get(r)
|
||||
if (err == nil) != tt.ok || value != tt.value {
|
||||
t.Errorf("failed to get {%q, %q}:\nexpected {value:%#v, ok:%#v},\ngot {value:%#v, err:%v}", tt.source, tt.name, tt.value, tt.ok, value, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue