divisibleBy.json 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. [
  2. {
  3. "description": "by int",
  4. "schema": {"divisibleBy": 2},
  5. "tests": [
  6. {
  7. "description": "int by int",
  8. "data": 10,
  9. "valid": true
  10. },
  11. {
  12. "description": "int by int fail",
  13. "data": 7,
  14. "valid": false
  15. },
  16. {
  17. "description": "ignores non-numbers",
  18. "data": "foo",
  19. "valid": true
  20. }
  21. ]
  22. },
  23. {
  24. "description": "by number",
  25. "schema": {"divisibleBy": 1.5},
  26. "tests": [
  27. {
  28. "description": "zero is divisible by anything (except 0)",
  29. "data": 0,
  30. "valid": true
  31. },
  32. {
  33. "description": "4.5 is divisible by 1.5",
  34. "data": 4.5,
  35. "valid": true
  36. },
  37. {
  38. "description": "35 is not divisible by 1.5",
  39. "data": 35,
  40. "valid": false
  41. }
  42. ]
  43. },
  44. {
  45. "description": "by small number",
  46. "schema": {"divisibleBy": 0.0001},
  47. "tests": [
  48. {
  49. "description": "0.0075 is divisible by 0.0001",
  50. "data": 0.0075,
  51. "valid": true
  52. },
  53. {
  54. "description": "0.00751 is not divisible by 0.0001",
  55. "data": 0.00751,
  56. "valid": false
  57. }
  58. ]
  59. }
  60. ]