match_test.go 499 B

123456789101112131415161718192021222324252627
  1. package fp_test
  2. import (
  3. "testing"
  4. fp "github.com/cloudflare/mitmengine/fputil"
  5. "github.com/cloudflare/mitmengine/testutil"
  6. )
  7. func TestMatchString(t *testing.T) {
  8. var tests = []struct {
  9. in fp.Match
  10. out string
  11. }{
  12. {fp.MatchEmpty, "empty"},
  13. {fp.MatchImpossible, "impossible"},
  14. {fp.MatchUnlikely, "unlikely"},
  15. {fp.MatchPossible, "possible"},
  16. {fp.Match(255), "Match(255)"},
  17. }
  18. for _, test := range tests {
  19. actual := test.in.String()
  20. testutil.Equals(t, test.out, actual)
  21. }
  22. }