all repos — min @ 7e67cd88c1be12ebcd1ee4bbed1d2ee68056559e

A small but practical concatenative programming language.

tests/dstore.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
;;;

"dstore" test.describe

  ("dstore.json" dsinit type "dict:datastore" ==) test.assert
  
  (
    "dstore.json" dsread :ds
    ds "tests"
    {}
      1 "test1" dset
      2 "test2" dset
    dspost dswrite
    "tests" (pop true) dsquery size 1 ==
  ) test.assert
  
  (
    "dstore.json" dsread :ds
    ds "tests/aaa"
    {}
      1 "test1" dset
      3 "test3" dset
    dsput dswrite
    "tests" ("test1" dget 1 ==) dsquery size 2 ==
  ) test.assert
  
  (
    "dstore.json" dsread :ds
    ds "tests/aaa" dsdelete
    "tests" ("id" dget "aaa" ==) dsquery size 0 ==
  ) test.assert
  
  "dstore.json" rm

  test.report
  clear-stack