regex_match_test.go 232 B

123456789101112131415161718
  1. package match
  2. import (
  3. "pmail/models"
  4. "testing"
  5. )
  6. func TestRegexMatch_Match(t *testing.T) {
  7. r := NewRegexMatch("Subject", "\\d+")
  8. ret := r.Match(nil, &models.Email{
  9. Subject: "111",
  10. })
  11. if !ret {
  12. t.Errorf("失败")
  13. }
  14. }