/[cl-table]/test.lisp
ViewVC logotype

Contents of /test.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Wed Mar 20 17:22:22 2013 UTC (12 months, 4 weeks ago) by rklochkov
File size: 1456 byte(s)
Minor fixes
1 (defpackage #:cl-table-test
2 (:use #:cl #:cl-table))
3
4 (in-package #:cl-table-test)
5
6 (defun test ()
7 (let ((tab (make-instance 'table :columns '(a b))))
8 (let ((str (add tab)))
9 (setf (field str 'a) "str1a"
10 (field str 'b) "str1b"))
11 (let ((str (add tab)))
12 (setf (field str 'a) "str2a"
13 (field str 'b) "str2b")
14 (let ((str2 (add str)))
15 (setf (field str2 'a) "str21a"
16 (field str2 'b) "str21b")))
17 (list (field (path->row tab '(0)) 'b)
18 (field (path->row tab 1) 'a)
19 (field (path->row tab '(1 0)) 'b))
20 (path->row tab '(1 0))))
21
22
23
24 (let ((tab (make-instance 'table :columns '(a b))))
25 (let ((str (add tab)))
26 (setf (field str 'a) "str1a"
27 (field str 'b) "str1b"))
28 (let ((str (add tab)))
29 (setf (field str 'a) "str2a"
30 (field str 'b) "str2b")
31 (let ((str2 (add str)))
32 (setf (field str2 'a) "str21a"
33 (field str2 'b) "str21b")))
34
35 (assert (equalp '("str1b" "str2a" "str21b")
36 (list (field (path->row tab '(0)) 'b)
37 (field (path->row tab 1) 'a)
38 (field (path->row tab '(1 0)) 'b))))
39 (let ((tab2 (make-iterator tab)))
40 (assert (equalp '("str1b" "str2a" "str21b")
41 (list (field (path->row tab2 '(0)) 'b)
42 (field (path->row tab2 1) 'a)
43 (field (path->row tab2 '(1 0)) 'b))))))
44
45
46

  ViewVC Help
Powered by ViewVC 1.1.5