all repos — min @ 946beb6e1b99280a1b8f2304218211f6b1d2085c

A small but practical concatenative programming language.

tests/store.min

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
'min-test require :test
;;;

"store" test.describe

  ("store.json" store.init type "dict:datastore" ==) test.assert
  
  (
    "store.json" store.read :ds
    ds "tests"
    {}
      1 "test1" dict.set
      2 "test2" dict.set
    store.post store.write
    "tests" (stack.pop true) store.query size 1 ==
  ) test.assert
  
  (
    "store.json" store.read :ds
    ds "tests/aaa"
    {}
      1 "test1" dict.set
      3 "test3" dict.set
    store.put store.write
    "tests" ("test1" dict.get 1 ==) store.query size 2 ==
  ) test.assert
  
  (
    "store.json" store.read :ds
    ds "tests/aaa" store.delete
    "tests" ("id" dict.get "aaa" ==) store.query size 0 ==
  ) test.assert
  
  "store.json" sys.rm

  test.report
  stack.clear