r10077: * multiple: Apply patch from Joerg Hoehle with multiple
[clsql.git] / tests / test-fdml.lisp
index eac258f278200a4f5db41fc19428c5655a97dbc7..f067e1e48c3465352a7303796fa5cff20068786c 100644 (file)
  ("1" "2" "3" "4"))
 
 (deftest :fdml/select/21 
-  (clsql:select [substr [first-name] 1 4] :from [employee] 
+  (clsql:select [substring [first-name] 1 4] :from [employee] 
                 :flatp t :order-by [emplid] :field-names nil)
  ("Vlad" "Jose" "Leon" "Niki" "Leon" "Yuri" "Kons" "Mikh" "Bori" "Vlad"))
 
                  :flatp t :result-types nil :field-names nil)))
   ("Lenin" "Stalin" "Trotsky" "Kruschev"))
 
+;; test escaping of single quotes 
+(deftest :fdml/select/35 
+    (clsql:select "What's up doc?" :from [employee] :flatp t :field-names nil)
+  ("What's up doc?" "What's up doc?" "What's up doc?" "What's up doc?"
+   "What's up doc?" "What's up doc?" "What's up doc?" "What's up doc?"
+   "What's up doc?" "What's up doc?"))
+
+;; test proper treatment of backslash (depending on backend) 
+(deftest :fdml/select/36
+    (clsql:select "foo\\bar\\baz" :from [employee] :flatp t :field-names nil)
+ ("foo\\bar\\baz" "foo\\bar\\baz" "foo\\bar\\baz" "foo\\bar\\baz" 
+  "foo\\bar\\baz"  "foo\\bar\\baz" "foo\\bar\\baz" "foo\\bar\\baz" 
+  "foo\\bar\\baz" "foo\\bar\\baz"))
+
 (deftest :fdml/do-query/1
     (let ((result '()))
     (clsql:do-query ((name) [select [last-name] :from [employee]
                          :flatp t)
             results)
       (apply #'values (nreverse results)))
-  nil :committed nil ("lenin-nospam@soviet.org") :committed
-  nil ("lenin@soviet.org"))
+  nil nil nil ("lenin-nospam@soviet.org") nil nil ("lenin@soviet.org"))
 
 ;; runs a valid update and an invalid one within a transaction and checks
 ;; that the valid update is rolled back when the invalid one fails.