projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9199: fold clsql-base and clsql-base-sys into clsql-base
[clsql.git]
/
tests
/
test-fdml.lisp
diff --git
a/tests/test-fdml.lisp
b/tests/test-fdml.lisp
index 929e30dd1979698df8f111677034d3507fa3e35a..f3b9d13f718ff921f9bbafc966978d320a9fb0e2 100644
(file)
--- a/
tests/test-fdml.lisp
+++ b/
tests/test-fdml.lisp
@@
-128,16
+128,31
@@
(("Vladamir" "Lenin" "lenin@soviet.org")))
(("Vladamir" "Lenin" "lenin@soviet.org")))
+;; Computed values are not always classified as numeric by psqlodbc
(deftest :fdml/query/1
(deftest :fdml/query/1
- (clsql:query "SELECT COUNT(*) FROM EMPLOYEE WHERE (EMAIL LIKE '%org')")
- (("10")))
+ (let ((count (caar (clsql:query "SELECT COUNT(*) FROM EMPLOYEE WHERE (EMAIL LIKE '%org')" :field-names nil))))
+ (if (stringp count)
+ (nth-value 0 (parse-integer count))
+ count))
+ 10)
(deftest :fdml/query/2
(deftest :fdml/query/2
- (clsql:query
- "SELECT FIRST_NAME,LAST_NAME FROM EMPLOYEE WHERE (EMPLID <= 5) ORDER BY LAST_NAME")
+ (multiple-value-bind (rows field-names)
+ (clsql:query
+ "SELECT FIRST_NAME,LAST_NAME FROM EMPLOYEE WHERE (EMPLID <= 5) ORDER BY LAST_NAME")
+ (values rows (mapcar 'string-upcase field-names)))
(("Leonid" "Brezhnev") ("Nikita" "Kruschev") ("Vladamir" "Lenin")
(("Leonid" "Brezhnev") ("Nikita" "Kruschev") ("Vladamir" "Lenin")
- ("Josef" "Stalin") ("Leon" "Trotsky")))
+ ("Josef" "Stalin") ("Leon" "Trotsky"))
+ ("FIRST_NAME" "LAST_NAME"))
+(deftest :fdml/query/3
+ (caar (clsql:query "SELECT EMPLID FROM EMPLOYEE WHERE LAST_NAME = 'Andropov'" :field-names nil))
+ 6)
+
+(deftest :fdml/query/4
+ (typep (caar (clsql:query "SELECT HEIGHT FROM EMPLOYEE WHERE LAST_NAME = 'Andropov'" :field-names nil))
+ 'float)
+ t)
(deftest :fdml/execute-command/1
(values
(deftest :fdml/execute-command/1
(values