X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-fdml.lisp;h=33267a52f33d580866d7017f513fa09b7d8cc942;hb=21ffe5f820036726c6353a16dfb478fb41aa700c;hp=93d3597d8cc959b65366e144f238ee4d6424ca1e;hpb=71ac7a8d3e5bea99472b07fa2a089c7173abb1f7;p=clsql.git diff --git a/tests/test-fdml.lisp b/tests/test-fdml.lisp index 93d3597..33267a5 100644 --- a/tests/test-fdml.lisp +++ b/tests/test-fdml.lisp @@ -248,7 +248,7 @@ ("lenin@soviet.org")) (deftest :fdml/select/6 - (if (db-type-has-fancy-math? *test-database-underlying-type*) + (if (clsql-sys:db-type-has-fancy-math? *test-database-underlying-type*) (mapcar #'(lambda (s) (parse-integer s :junk-allowed t)) (clsql:select [function "trunc" [height]] :from [employee] :result-types nil @@ -350,30 +350,49 @@ :field-names nil :result-types nil :flatp t) ("1" "2" "3" "4")) -(deftest :fdml/select/20 +(deftest :fdml/select/21 (clsql:select [substr [first-name] 1 4] :from [employee] :flatp t :order-by [emplid] :field-names nil) ("Vlad" "Jose" "Leon" "Niki" "Leon" "Yuri" "Kons" "Mikh" "Bori" "Vlad")) -(deftest :fdml/select/21 - (clsql:select [\|\| [first-name] " " [last-name]] :from [employee] +(deftest :fdml/select/22 + (clsql:select [|| [first-name] " " [last-name]] :from [employee] :flatp t :order-by [emplid] :field-names nil) ("Vladamir Lenin" "Josef Stalin" "Leon Trotsky" "Nikita Kruschev" "Leonid Brezhnev" "Yuri Andropov" "Konstantin Chernenko" "Mikhail Gorbachev" "Boris Yeltsin" "Vladamir Putin")) -(deftest :fdml/select/22 +(deftest :fdml/select/23 (clsql:select [emplid] :from [employee] :where [in [emplid] '(1 2 3 4)] :flatp t :order-by [emplid] :field-names nil :result-types nil) ("1" "2" "3" "4")) -(deftest :fdml/select/23 +(deftest :fdml/select/24 (clsql:select [distinct [first-name]] :from [employee] :flatp t :order-by [first-name] :field-names nil :result-types nil) ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladamir" "Yuri")) +(deftest :fdml/select/25 + (clsql:select [first-name] :from "employee" :flatp t :distinct t + :field-names nil + :result-types nil + :order-by [first-name]) + ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladamir" + "Yuri")) + +(deftest :fdml/select/26 + (clsql:select ["table" first-name] ["table" last-name] + :from '([employee "table"] [employee "join"]) + :where [and [= ["table" first-name] + ["join" first-name]] + [not [= ["table" emplid] + ["join" emplid]]]] + :order-by '(["table" last-name]) + :result-types nil :field-names nil) + (("Vladamir" "Lenin") ("Vladamir" "Putin"))) + ;(deftest :fdml/select/11 ; (clsql:select [emplid] :from [employee] ; :where [= [emplid] [any [select [companyid] :from [company]]]]