numeric_filter.json 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. [
  2. {
  3. "desc": "Numeric format should still return a string if field isn't allowed",
  4. "query": "random_field:>500",
  5. "result": [
  6. {"type": "spaces", "value": ""},
  7. {
  8. "type": "filter",
  9. "filter": "text",
  10. "negated": false,
  11. "key": {"type": "keySimple", "value": "random_field", "quoted": false},
  12. "operator": "",
  13. "value": {"type": "valueText", "value": ">500", "quoted": false}
  14. },
  15. {"type": "spaces", "value": ""}
  16. ]
  17. },
  18. {
  19. "desc": "Numeric format should not negate operator if field isn't allowed",
  20. "query": "!random_field:>500",
  21. "result": [
  22. {"type": "spaces", "value": ""},
  23. {
  24. "type": "filter",
  25. "filter": "text",
  26. "negated": true,
  27. "key": {"type": "keySimple", "value": "random_field", "quoted": false},
  28. "operator": "",
  29. "value": {"type": "valueText", "value": ">500", "quoted": false}
  30. },
  31. {"type": "spaces", "value": ""}
  32. ]
  33. },
  34. {
  35. "query": "!random_field:500",
  36. "result": [
  37. {"type": "spaces", "value": ""},
  38. {
  39. "type": "filter",
  40. "filter": "text",
  41. "negated": true,
  42. "key": {"type": "keySimple", "value": "random_field", "quoted": false},
  43. "operator": "",
  44. "value": {"type": "valueText", "value": "500", "quoted": false}
  45. },
  46. {"type": "spaces", "value": ""}
  47. ]
  48. },
  49. {
  50. "query": "project_id:-500",
  51. "result": [
  52. {"type": "spaces", "value": ""},
  53. {
  54. "type": "filter",
  55. "filter": "numeric",
  56. "negated": false,
  57. "key": {"type": "keySimple", "value": "project_id", "quoted": false},
  58. "operator": "",
  59. "value": {
  60. "type": "valueNumber",
  61. "value": "-500",
  62. "unit": null,
  63. "parsed": {"value": -500}
  64. }
  65. },
  66. {"type": "spaces", "value": ""}
  67. ]
  68. },
  69. {
  70. "query": "!issue.id:500",
  71. "result": [
  72. {"type": "spaces", "value": ""},
  73. {
  74. "type": "filter",
  75. "filter": "numeric",
  76. "negated": true,
  77. "key": {"type": "keySimple", "value": "issue.id", "quoted": false},
  78. "operator": "",
  79. "value": {
  80. "type": "valueNumber",
  81. "value": "500",
  82. "unit": null,
  83. "parsed": {"value": 500}
  84. }
  85. },
  86. {"type": "spaces", "value": ""}
  87. ]
  88. },
  89. {
  90. "query": "issue.id:<500",
  91. "result": [
  92. {"type": "spaces", "value": ""},
  93. {
  94. "type": "filter",
  95. "filter": "numeric",
  96. "negated": false,
  97. "key": {"type": "keySimple", "value": "issue.id", "quoted": false},
  98. "operator": "<",
  99. "value": {
  100. "type": "valueNumber",
  101. "value": "500",
  102. "unit": null,
  103. "parsed": {"value": 500}
  104. }
  105. },
  106. {"type": "spaces", "value": ""}
  107. ]
  108. }
  109. ]