(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestRule_Init_Composite(t *testing.T) { |
| 33 | rule := NewRule() |
| 34 | rule.Param = "${arg.name} ${arg.age}" |
| 35 | rule.Operator = RuleOperatorContains |
| 36 | rule.Value = "lu" |
| 37 | err := rule.Init() |
| 38 | if err != nil { |
| 39 | t.Fatal(err) |
| 40 | } |
| 41 | t.Log(rule.singleParam, rule.singleCheckpoint) |
| 42 | |
| 43 | rawReq, err := http.NewRequest(http.MethodGet, "http://teaos.cn/hello?name=lu&age=20", nil) |
| 44 | if err != nil { |
| 45 | t.Fatal(err) |
| 46 | } |
| 47 | req := requests.NewTestRequest(rawReq) |
| 48 | t.Log(rule.MatchRequest(req)) |
| 49 | } |
| 50 | |
| 51 | func TestRule_Test(t *testing.T) { |
| 52 | var a = assert.NewAssertion(t) |
nothing calls this directly
no test coverage detected