X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-fdml.lisp;h=906852be6d49d1d645f9e334167be60cc1b45863;hb=a99f275949c7e638a1e7fcf2ebfbb21f0a8c448a;hp=39aac724057fcec3b61209ef9ef02725503cd52e;hpb=1751e5245c270bd1ee854a98dfe6caa665abe34e;p=clsql.git diff --git a/tests/test-fdml.lisp b/tests/test-fdml.lisp index 39aac72..906852b 100644 --- a/tests/test-fdml.lisp +++ b/tests/test-fdml.lisp @@ -276,17 +276,28 @@ (deftest :fdml/select/13 (multiple-value-bind (results field-names) - (clsql:select [emplid] [last-name] [married] :from [employee] + (clsql:select [emplid] [last-name] :from [employee] :where [= [emplid] 1]) (values results (mapcar #'string-downcase field-names))) - ((1 "Lenin" "t")) - ("emplid" "last_name" "married")) - + ((1 "Lenin")) + ("emplid" "last_name")) + (deftest :fdml/select/14 (floatp (car (clsql:select [height] :from [employee] :where [= [emplid] 1] :flatp t))) t) +(deftest :fdml/select/15 + (multiple-value-bind (rows field-names) + (clsql:select [emplid] [street-number] [street-name] [city_field] [zip] + :from [address] + :where [= 1 [emplid]]) + (values + rows + (mapcar #'string-downcase field-names))) + ((1 10 "Park Place" "Leningrad" 123)) + ("emplid" "street_number" "street_name" "city_field" "zip")) + ;(deftest :fdml/select/11 ; (clsql:select [emplid] :from [employee] ; :where [= [emplid] [any [select [companyid] :from [company]]]] @@ -323,7 +334,21 @@ collect (concatenate 'string forename " " surname)) ("Yuri Andropov" "Leonid Brezhnev" "Konstantin Chernenko" "Mikhail Gorbachev" "Nikita Kruschev" "Vladamir Lenin" "Vladamir Putin" - "Josef Stalin" "Leon Trotsky" "Boris Yeltsin")) + "Josef Stalin" "Leon Trotsky" "Boris Yeltsin")) + +(deftest :fdml/loop/2 + (loop for (emplid) + being each tuple in + [select [emplid] :from [address] :order-by [emplid]] + collect emplid) + (1 2)) + +(deftest :fdml/loop/3 + (loop for emplid + being each tuple in + [select [emplid] :from [address] :order-by [emplid]] + collect emplid) + (1 2)) ;; starts a transaction deletes a record and then rolls back the deletion (deftest :fdml/transaction/1