projects
/
clsql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2cc9dbd
)
Make some oodml/update-records tests more robust. :update-records/9 and 9-slots:...
author
Holger Schauer
<Holger.Schauer@gmx.de>
Wed, 9 Mar 2011 18:14:43 +0000
(19:14 +0100)
committer
Kevin M. Rosenberg
<kevin@rosenberg.net>
Wed, 30 Mar 2011 00:20:06 +0000
(18:20 -0600)
tests/test-oodml.lisp
patch
|
blob
|
history
diff --git
a/tests/test-oodml.lisp
b/tests/test-oodml.lisp
index 29b80592a9f75948a8cfe8478ca85dc0513ea077..f0d3d9b9e98baed6c1e9aaee674abb503d09dfe1 100644
(file)
--- a/
tests/test-oodml.lisp
+++ b/
tests/test-oodml.lisp
@@
-554,6
+554,8
@@
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
+ (unless sl
+ (error "Couldn't find expected sublocation"))
(format nil "~a ~a ~a"
(slot-value sl 'subloc-id)
(slot-value sl 'title)
(format nil "~a ~a ~a"
(slot-value sl 'subloc-id)
(slot-value sl 'title)
@@
-576,6
+578,8
@@
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
+ (unless sl
+ (error "In psfl: found no sublocation with id = 10"))
(format nil "~a ~a ~a"
(slot-value sl 'subloc-id)
(slot-value sl 'title)
(format nil "~a ~a ~a"
(slot-value sl 'subloc-id)
(slot-value sl 'title)
@@
-585,6
+589,8
@@
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
+ (unless sl
+ (error "Select for modification: Found no sublocation with id = 10"))
(setf (slot-value sl 'title) "Altered subloc title")
(setf (slot-value sl 'loc) "Altered loc")
(clsql:update-record-from-slot sl 'title)
(setf (slot-value sl 'title) "Altered subloc title")
(setf (slot-value sl 'loc) "Altered loc")
(clsql:update-record-from-slot sl 'title)
@@
-593,9
+599,11
@@
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
(let ((sl (car (clsql:select 'subloc
:where [= 10 [slot-value 'subloc 'subloc-id]]
:flatp t :caching nil))))
+ (unless sl
+ (error "Select for next modification: Found no sublocation with id = 10"))
(setf (slot-value sl 'title) "subloc-1")
(setf (slot-value sl 'loc) "a subloc")
(setf (slot-value sl 'title) "subloc-1")
(setf (slot-value sl 'loc) "a subloc")
- (clsql:update-record-from-slot sl '(title loc))
+ (clsql:update-record-from-slot
s
sl '(title loc))
(print-fresh-subloc)))))
"10 subloc-1 a subloc"
"10 Altered subloc title Altered loc"
(print-fresh-subloc)))))
"10 subloc-1 a subloc"
"10 Altered subloc title Altered loc"