Commit 302b38d7 authored by Dave Griffiths's avatar Dave Griffiths

added unit tests

parent f0786e6c
#!/usr/bin/env racket
#lang racket
(define (db-open db-name)
((file-exists? (string->path db-name))
(display "open existing db")(newline)
(open (string->path db-name)))
(display "making new db")(newline)
(let ((db (open (string->path db-name))))
;; todo, dynamically create these tables
(setup db "sync")
(setup db "stream")
(define db-name "unit-test.db")
((exn:fail? (lambda (e) (msg e))))
(delete-file db-name))
(define db (db-open db-name))
(open-log "unit-test-log.txt")
(define (unit-tests)
;; db
(msg "testing db")
(define db "unit-test.db")
(set! db (db-open db))
;;(msg (db-status db))
;; test low level sql
(sql-test db)
;; test the entity attribute value system
(define table "eavunittest")
(setup db table)
(entity-update-test db table)
(entity-sync-test db table)
(msg (csv db table "thing"))
(msg (db-status db))
(msg "test over...")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment