basic.json 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. [{
  2. "given":
  3. {"foo": {"bar": {"baz": "correct"}}},
  4. "cases": [
  5. {
  6. "expression": "foo",
  7. "result": {"bar": {"baz": "correct"}}
  8. },
  9. {
  10. "expression": "foo.bar",
  11. "result": {"baz": "correct"}
  12. },
  13. {
  14. "expression": "foo.bar.baz",
  15. "result": "correct"
  16. },
  17. {
  18. "expression": "foo\n.\nbar\n.baz",
  19. "result": "correct"
  20. },
  21. {
  22. "expression": "foo.bar.baz.bad",
  23. "result": null
  24. },
  25. {
  26. "expression": "foo.bar.bad",
  27. "result": null
  28. },
  29. {
  30. "expression": "foo.bad",
  31. "result": null
  32. },
  33. {
  34. "expression": "bad",
  35. "result": null
  36. },
  37. {
  38. "expression": "bad.morebad.morebad",
  39. "result": null
  40. }
  41. ]
  42. },
  43. {
  44. "given":
  45. {"foo": {"bar": ["one", "two", "three"]}},
  46. "cases": [
  47. {
  48. "expression": "foo",
  49. "result": {"bar": ["one", "two", "three"]}
  50. },
  51. {
  52. "expression": "foo.bar",
  53. "result": ["one", "two", "three"]
  54. }
  55. ]
  56. },
  57. {
  58. "given": ["one", "two", "three"],
  59. "cases": [
  60. {
  61. "expression": "one",
  62. "result": null
  63. },
  64. {
  65. "expression": "two",
  66. "result": null
  67. },
  68. {
  69. "expression": "three",
  70. "result": null
  71. },
  72. {
  73. "expression": "one.two",
  74. "result": null
  75. }
  76. ]
  77. },
  78. {
  79. "given":
  80. {"foo": {"1": ["one", "two", "three"], "-1": "bar"}},
  81. "cases": [
  82. {
  83. "expression": "foo.\"1\"",
  84. "result": ["one", "two", "three"]
  85. },
  86. {
  87. "expression": "foo.\"1\"[0]",
  88. "result": "one"
  89. },
  90. {
  91. "expression": "foo.\"-1\"",
  92. "result": "bar"
  93. }
  94. ]
  95. }
  96. ]