X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-basic.lisp;h=2c13d803f6f6d9a628cc6946805352da8c458240;hb=6f5877c86265e4cbf3bf3904a287c46eb1211a32;hp=03ed1e1c4b03e9a2093aa1fb0dc25d7af4821115;hpb=0e06463bcfc9e4f9d1eec15b7746eb7f07cf2f2b;p=clsql.git diff --git a/tests/test-basic.lisp b/tests/test-basic.lisp index 03ed1e1..2c13d80 100644 --- a/tests/test-basic.lisp +++ b/tests/test-basic.lisp @@ -201,6 +201,42 @@ results))))) ((t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t))) + + (deftest :basic/bigtext/1 + (with-dataset *ds-bigtext* + (let* ((len 7499) + (str (make-string len :initial-element #\a)) + (cmd (format nil "INSERT INTO testbigtext (a) VALUES ('~a')" str))) + (execute-command cmd) + (let ((a (first (query "SELECT a from testbigtext" + :flatp t :field-names nil)))) + (assert (string= str a) (str a) + "mismatch on a. inserted: ~a returned: ~a" len (length a))) + )) + nil) + (deftest :basic/bigtext/2 + (dotimes (n 10) + (with-dataset *ds-bigtext* + (let* ((len (random 7500)) + (str (make-string len :initial-element #\a)) + (cmd (format nil "INSERT INTO testbigtext (a) VALUES ('~a')" str))) + (execute-command cmd) + (let ((a (first (query "SELECT a from testbigtext" + :flatp t :field-names nil)))) + (assert (string= str a) (str a) + "mismatch on a. inserted: ~a returned: ~a" len (length a))) + ))) + nil) + + (deftest :basic/i18n/1 + (first (query "SELECT 'Iñtërnâtiônàlizætiøn'" + :flatp t :field-names nil)) + "Iñtërnâtiônàlizætiøn") + + (deftest :basic/i18n/2 + (first (query "SELECT 'Iñtërnâtiônàližætiøn'" + :flatp t :field-names nil)) + "Iñtërnâtiônàližætiøn") )) @@ -256,3 +292,7 @@ (if (> diff (* 10 double-float-epsilon)) nil t)))) + +(def-dataset *ds-bigtext* + (:setup "CREATE TABLE testbigtext(a varchar(7500))") + (:cleanup "DROP TABLE testbigtext"))