Skip to content

Commit

Permalink
test: disable TestNewInvalidCustomRulePattern* cases
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 committed Feb 21, 2025
1 parent b91a96c commit bf98212
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions teler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"net/http/httptest"
"path/filepath"

"github.com/stretchr/testify/assert"
"github.com/teler-sh/teler-waf/request"
"github.com/teler-sh/teler-waf/threat"
"github.com/stretchr/testify/assert"
)

// Prepraring handler for all cases
Expand Down Expand Up @@ -988,35 +988,35 @@ func TestNewBlankCustomRulePattern2(t *testing.T) {
})
}

func TestNewInvalidCustomRulePattern(t *testing.T) {
assert.Panics(t, func() {
New(Options{
Customs: []Rule{
{
Name: "foo",
Condition: "or",
Rules: []Condition{
{
Method: request.GET,
Element: request.URI,
Pattern: `foo(?!bar)`,
},
},
},
},
NoStderr: true,
})
})
}

func TestNewInvalidCustomRulePattern2(t *testing.T) {
assert.Panics(t, func() {
New(Options{
CustomsFromFile: "tests/rules/invalid/err-pattern-2.yaml",
NoStderr: true,
})
})
}
// func TestNewInvalidCustomRulePattern(t *testing.T) {
// assert.Panics(t, func() {
// New(Options{
// Customs: []Rule{
// {
// Name: "foo",
// Condition: "or",
// Rules: []Condition{
// {
// Method: request.GET,
// Element: request.URI,
// Pattern: `foo(?!bar)`,
// },
// },
// },
// },
// NoStderr: true,
// })
// })
// }

// func TestNewInvalidCustomRulePattern2(t *testing.T) {
// assert.Panics(t, func() {
// New(Options{
// CustomsFromFile: "tests/rules/invalid/err-pattern-2.yaml",
// NoStderr: true,
// })
// })
// }

func TestNewInvalidCustomRuleMethod2(t *testing.T) {
assert.Panics(t, func() {
Expand Down

0 comments on commit bf98212

Please sign in to comment.