X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=tests%2Ftest-basic.lisp;h=b0e85875b5dedc5fe90ebe09efbc4c806cbb68d5;hp=03ed1e1c4b03e9a2093aa1fb0dc25d7af4821115;hb=d2d49ab13c98bc7a1819a0fd3968268a5567bdc3;hpb=0e06463bcfc9e4f9d1eec15b7746eb7f07cf2f2b diff --git a/tests/test-basic.lisp b/tests/test-basic.lisp index 03ed1e1..b0e8587 100644 --- a/tests/test-basic.lisp +++ b/tests/test-basic.lisp @@ -7,9 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Created: Mar 2002 ;;;; -;;;; $Id$ -;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg +;;;; This file, part of CLSQL, is Copyright (c) 2002-2010 by Kevin M. Rosenberg ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License @@ -201,6 +199,32 @@ 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 +280,7 @@ (if (> diff (* 10 double-float-epsilon)) nil t)))) + +(def-dataset *ds-bigtext* + (:setup "CREATE TABLE testbigtext(a varchar(7500))") + (:cleanup "DROP TABLE testbigtext"))