boolean.json 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. "emptylist": [],
  210. "boolvalue": false
  211. },
  212. "cases": [
  213. {
  214. "expression": "one < two",
  215. "result": true
  216. },
  217. {
  218. "expression": "one <= two",
  219. "result": true
  220. },
  221. {
  222. "expression": "one == one",
  223. "result": true
  224. },
  225. {
  226. "expression": "one == two",
  227. "result": false
  228. },
  229. {
  230. "expression": "one > two",
  231. "result": false
  232. },
  233. {
  234. "expression": "one >= two",
  235. "result": false
  236. },
  237. {
  238. "expression": "one != two",
  239. "result": true
  240. },
  241. {
  242. "expression": "emptylist < one",
  243. "result": null
  244. },
  245. {
  246. "expression": "emptylist < nullvalue",
  247. "result": null
  248. },
  249. {
  250. "expression": "emptylist < boolvalue",
  251. "result": null
  252. },
  253. {
  254. "expression": "one < boolvalue",
  255. "result": null
  256. },
  257. {
  258. "expression": "one < two && three > one",
  259. "result": true
  260. },
  261. {
  262. "expression": "one < two || three > one",
  263. "result": true
  264. },
  265. {
  266. "expression": "one < two || three < one",
  267. "result": true
  268. },
  269. {
  270. "expression": "two < one || three < one",
  271. "result": false
  272. }
  273. ]
  274. }
  275. ]