(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestRule_Init_Single(t *testing.T) { |
| 14 | rule := NewRule() |
| 15 | rule.Param = "${arg.name}" |
| 16 | rule.Operator = RuleOperatorEqString |
| 17 | rule.Value = "lu" |
| 18 | err := rule.Init() |
| 19 | if err != nil { |
| 20 | t.Fatal(err) |
| 21 | } |
| 22 | t.Log(rule.singleParam, rule.singleCheckpoint) |
| 23 | rawReq, err := http.NewRequest(http.MethodGet, "http://teaos.cn/hello?name=lu&age=20", nil) |
| 24 | if err != nil { |
| 25 | t.Fatal(err) |
| 26 | } |
| 27 | |
| 28 | req := requests.NewTestRequest(rawReq) |
| 29 | t.Log(rule.MatchRequest(req)) |
| 30 | } |
| 31 | |
| 32 | func TestRule_Init_Composite(t *testing.T) { |
| 33 | rule := NewRule() |
nothing calls this directly
no test coverage detected