boolean.json 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. [
  2. {
  3. "given": {
  4. "outer": {
  5. "foo": "foo",
  6. "bar": "bar",
  7. "baz": "baz"
  8. }
  9. },
  10. "cases": [
  11. {
  12. "expression": "outer.foo || outer.bar",
  13. "result": "foo"
  14. },
  15. {
  16. "expression": "outer.foo||outer.bar",
  17. "result": "foo"
  18. },
  19. {
  20. "expression": "outer.bar || outer.baz",
  21. "result": "bar"
  22. },
  23. {
  24. "expression": "outer.bar||outer.baz",
  25. "result": "bar"
  26. },
  27. {
  28. "expression": "outer.bad || outer.foo",
  29. "result": "foo"
  30. },
  31. {
  32. "expression": "outer.bad||outer.foo",
  33. "result": "foo"
  34. },
  35. {
  36. "expression": "outer.foo || outer.bad",
  37. "result": "foo"
  38. },
  39. {
  40. "expression": "outer.foo||outer.bad",
  41. "result": "foo"
  42. },
  43. {
  44. "expression": "outer.bad || outer.alsobad",
  45. "result": null
  46. },
  47. {
  48. "expression": "outer.bad||outer.alsobad",
  49. "result": null
  50. }
  51. ]
  52. },
  53. {
  54. "given": {
  55. "outer": {
  56. "foo": "foo",
  57. "bool": false,
  58. "empty_list": [],
  59. "empty_string": ""
  60. }
  61. },
  62. "cases": [
  63. {
  64. "expression": "outer.empty_string || outer.foo",
  65. "result": "foo"
  66. },
  67. {
  68. "expression": "outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo",
  69. "result": "foo"
  70. }
  71. ]
  72. },
  73. {
  74. "given": {
  75. "True": true,
  76. "False": false,
  77. "Number": 5,
  78. "EmptyList": [],
  79. "Zero": 0
  80. },
  81. "cases": [
  82. {
  83. "expression": "True && False",
  84. "result": false
  85. },
  86. {
  87. "expression": "False && True",
  88. "result": false
  89. },
  90. {
  91. "expression": "True && True",
  92. "result": true
  93. },
  94. {
  95. "expression": "False && False",
  96. "result": false
  97. },
  98. {
  99. "expression": "True && Number",
  100. "result": 5
  101. },
  102. {
  103. "expression": "Number && True",
  104. "result": true
  105. },
  106. {
  107. "expression": "Number && False",
  108. "result": false
  109. },
  110. {
  111. "expression": "Number && EmptyList",
  112. "result": []
  113. },
  114. {
  115. "expression": "Number && True",
  116. "result": true
  117. },
  118. {
  119. "expression": "EmptyList && True",
  120. "result": []
  121. },
  122. {
  123. "expression": "EmptyList && False",
  124. "result": []
  125. },
  126. {
  127. "expression": "True || False",
  128. "result": true
  129. },
  130. {
  131. "expression": "True || True",
  132. "result": true
  133. },
  134. {
  135. "expression": "False || True",
  136. "result": true
  137. },
  138. {
  139. "expression": "False || False",
  140. "result": false
  141. },
  142. {
  143. "expression": "Number || EmptyList",
  144. "result": 5
  145. },
  146. {
  147. "expression": "Number || True",
  148. "result": 5
  149. },
  150. {
  151. "expression": "Number || True && False",
  152. "result": 5
  153. },
  154. {
  155. "expression": "(Number || True) && False",
  156. "result": false
  157. },
  158. {
  159. "expression": "Number || (True && False)",
  160. "result": 5
  161. },
  162. {
  163. "expression": "!True",
  164. "result": false
  165. },
  166. {
  167. "expression": "!False",
  168. "result": true
  169. },
  170. {
  171. "expression": "!Number",
  172. "result": false
  173. },
  174. {
  175. "expression": "!EmptyList",
  176. "result": true
  177. },
  178. {
  179. "expression": "True && !False",
  180. "result": true
  181. },
  182. {
  183. "expression": "True && !EmptyList",
  184. "result": true
  185. },
  186. {
  187. "expression": "!False && !EmptyList",
  188. "result": true
  189. },
  190. {
  191. "expression": "!(True && False)",
  192. "result": true
  193. },
  194. {
  195. "expression": "!Zero",
  196. "result": false
  197. },
  198. {
  199. "expression": "!!Zero",
  200. "result": true
  201. }
  202. ]
  203. },
  204. {
  205. "given": {
  206. "one": 1,
  207. "two": 2,
  208. "three": 3
  209. },
  210. "cases": [
  211. {
  212. "expression": "one < two",
  213. "result": true
  214. },
  215. {
  216. "expression": "one <= two",
  217. "result": true
  218. },
  219. {
  220. "expression": "one == one",
  221. "result": true
  222. },
  223. {
  224. "expression": "one == two",
  225. "result": false
  226. },
  227. {
  228. "expression": "one > two",
  229. "result": false
  230. },
  231. {
  232. "expression": "one >= two",
  233. "result": false
  234. },
  235. {
  236. "expression": "one != two",
  237. "result": true
  238. },
  239. {
  240. "expression": "one < two && three > one",
  241. "result": true
  242. },
  243. {
  244. "expression": "one < two || three > one",
  245. "result": true
  246. },
  247. {
  248. "expression": "one < two || three < one",
  249. "result": true
  250. },
  251. {
  252. "expression": "two < one || three < one",
  253. "result": false
  254. }
  255. ]
  256. }
  257. ]