gitea源码

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # test cases are from https://github.com/gobwas/glob/blob/master/glob_test.go
  2. pattern_all = "[a-z][!a-x]*cat*[h][!b]*eyes*"
  3. regexp_all = `^[a-z][^a-x].*cat.*[h][^b].*eyes.*$`
  4. fixture_all_match = "my cat has very bright eyes"
  5. fixture_all_mismatch = "my dog has very bright eyes"
  6. pattern_plain = "google.com"
  7. regexp_plain = `^google\.com$`
  8. fixture_plain_match = "google.com"
  9. fixture_plain_mismatch = "gobwas.com"
  10. pattern_multiple = "https://*.google.*"
  11. regexp_multiple = `^https:\/\/.*\.google\..*$`
  12. fixture_multiple_match = "https://account.google.com"
  13. fixture_multiple_mismatch = "https://google.com"
  14. pattern_alternatives = "{https://*.google.*,*yandex.*,*yahoo.*,*mail.ru}"
  15. regexp_alternatives = `^(https:\/\/.*\.google\..*|.*yandex\..*|.*yahoo\..*|.*mail\.ru)$`
  16. fixture_alternatives_match = "http://yahoo.com"
  17. fixture_alternatives_mismatch = "http://google.com"
  18. pattern_alternatives_suffix = "{https://*gobwas.com,http://exclude.gobwas.com}"
  19. regexp_alternatives_suffix = `^(https:\/\/.*gobwas\.com|http://exclude\.gobwas\.com)$`
  20. fixture_alternatives_suffix_first_match = "https://safe.gobwas.com"
  21. fixture_alternatives_suffix_first_mismatch = "http://safe.gobwas.com"
  22. fixture_alternatives_suffix_second = "http://exclude.gobwas.com"
  23. pattern_prefix = "abc*"
  24. regexp_prefix = `^abc.*$`
  25. pattern_suffix = "*def"
  26. regexp_suffix = `^.*def$`
  27. pattern_prefix_suffix = "ab*ef"
  28. regexp_prefix_suffix = `^ab.*ef$`
  29. fixture_prefix_suffix_match = "abcdef"
  30. fixture_prefix_suffix_mismatch = "af"
  31. pattern_alternatives_combine_lite = "{abc*def,abc?def,abc[zte]def}"
  32. regexp_alternatives_combine_lite = `^(abc.*def|abc.def|abc[zte]def)$`
  33. fixture_alternatives_combine_lite = "abczdef"
  34. pattern_alternatives_combine_hard = "{abc*[a-c]def,abc?[d-g]def,abc[zte]?def}"
  35. regexp_alternatives_combine_hard = `^(abc.*[a-c]def|abc.[d-g]def|abc[zte].def)$`
  36. fixture_alternatives_combine_hard = "abczqdef"