github的一些开源项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
1.4 KiB

  1. # This set of tests exercises the serialization/deserialization and code copy
  2. # functions in the library. It does not use UTF or JIT.
  3. #forbid_utf
  4. # Compile several patterns, push them onto the stack, and then write them
  5. # all to a file.
  6. #pattern push
  7. /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
  8. (?(DEFINE)
  9. (?<NAME_PAT>[a-z]+)
  10. (?<ADDRESS_PAT>\d+)
  11. )/x
  12. /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
  13. #save testsaved1
  14. # Do it again for some more patterns.
  15. /(*MARK:A)(*SKIP:B)(C|X)/mark
  16. /(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
  17. #save testsaved2
  18. #pattern -push
  19. # Reload the patterns, then pop them one by one and check them.
  20. #load testsaved1
  21. #load testsaved2
  22. #pop info
  23. foofoo
  24. barbar
  25. #pop mark
  26. C
  27. \= Expect no match
  28. D
  29. #pop
  30. AmanaplanacanalPanama
  31. #pop info
  32. metcalfe 33
  33. # Check for an error when different tables are used.
  34. /abc/push,tables=1
  35. /xyz/push,tables=2
  36. #save testsaved1
  37. #pop
  38. xyz
  39. #pop
  40. abc
  41. #pop should give an error
  42. pqr
  43. /abcd/pushcopy
  44. abcd
  45. #pop
  46. abcd
  47. #pop should give an error
  48. /abcd/push
  49. #popcopy
  50. abcd
  51. #pop
  52. abcd
  53. /abcd/push
  54. #save testsaved1
  55. #pop should give an error
  56. #load testsaved1
  57. #popcopy
  58. abcd
  59. #pop
  60. abcd
  61. #pop should give an error
  62. /abcd/pushtablescopy
  63. abcd
  64. #popcopy
  65. abcd
  66. #pop
  67. abcd
  68. # Must only specify one of these
  69. //push,pushcopy
  70. //push,pushtablescopy
  71. //pushcopy,pushtablescopy
  72. # End of testinput20