X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=tests%2Ftest-basic.lisp;h=98e986119fae8c6495caadc55d73ba3b00b4e87b;hp=03ed1e1c4b03e9a2093aa1fb0dc25d7af4821115;hb=f8a3685cf1911b090510f22eaa0734fb16d3fdb2;hpb=9b248752b3d64b8828ea05a96e168d42ea980518 diff --git a/tests/test-basic.lisp b/tests/test-basic.lisp index 03ed1e1..98e9861 100644 --- a/tests/test-basic.lisp +++ b/tests/test-basic.lisp @@ -201,6 +201,33 @@ 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) + )) @@ -256,3 +283,7 @@ (if (> diff (* 10 double-float-epsilon)) nil t)))) + +(def-dataset *ds-bigtext* + (:setup "CREATE TABLE testbigtext(a varchar(7500))") + (:cleanup "DROP TABLE testbigtext"))