use keywords for head field names; re-order variable definitions and other statements in test
This commit is contained in:
parent
ed457efd53
commit
6c36fdc72d
2 changed files with 9 additions and 6 deletions
|
@ -5,7 +5,7 @@
|
|||
(defpackage :scopes/storage/tracking
|
||||
(:use :common-lisp)
|
||||
(:local-nicknames (:storage :scopes/storage))
|
||||
(:export #:track #:head #:time-stamp #:data #:proplist
|
||||
(:export #:track #:head #:head-proplist #:time-stamp #:data
|
||||
#:container
|
||||
#:make-item
|
||||
#:insert
|
||||
|
@ -23,7 +23,7 @@
|
|||
(defclass container ()
|
||||
((item-factory :initform #'(lambda (cont head)
|
||||
(make-instance 'track :container cont :head head)))
|
||||
(head-fields :reader head-fields :initform '(taskid username))
|
||||
(head-fields :reader head-fields :initform '(:taskid :username))
|
||||
(table-name :reader table-name :initform :tracks)
|
||||
(indexes :reader indexes :initform '((taskid username) (username)))
|
||||
(storage :reader storage :initarg :storage)))
|
||||
|
|
|
@ -38,10 +38,13 @@
|
|||
(t:show-result)))
|
||||
|
||||
(defun test-track (st)
|
||||
(let* ((cont (make-instance 'tracking:container :storage st))
|
||||
(tr (tracking:make-item cont "t01" "john")))
|
||||
(let (cont tr)
|
||||
(setf cont (make-instance 'tracking:container :storage st))
|
||||
(storage:drop-table st :testing.tracks)
|
||||
(tracking:create-table cont)
|
||||
(tracking:insert tr)
|
||||
(setf tr (tracking:make-item cont "t01" "john"))
|
||||
(== (tracking:head tr) '("t01" "john"))
|
||||
(== (tracking:data tr) nil)))
|
||||
(== (tracking:head-proplist tr) '(:username "john" :taskid "t01"))
|
||||
(== (tracking:data tr) nil)
|
||||
(tracking:insert tr)
|
||||
))
|
||||
|
|
Loading…
Add table
Reference in a new issue