X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-internal.lisp;fp=tests%2Ftest-internal.lisp;h=1416862fc27c308a04c2791c9cd07e0e42f2df72;hb=eda507c3d35f484755f88f6bbbf3f9a880324a97;hp=adfab8a3acebfa9998638182c6a9090b218ec903;hpb=075e39151c03f27edcac82382ebeb47bc0c2eda1;p=clsql.git diff --git a/tests/test-internal.lisp b/tests/test-internal.lisp index adfab8a..1416862 100644 --- a/tests/test-internal.lisp +++ b/tests/test-internal.lisp @@ -38,5 +38,34 @@ (clsql-sys::prepared-sql-to-postgresql-sql "SELECT 'FOO' FROM BAR WHERE ID='Match?''?' AND CODE=?") "SELECT 'FOO' FROM BAR WHERE ID='Match?''?' AND CODE=$1") + (deftest :int/output-caching/1 + #.(locally-enable-sql-reader-syntax) + ;; ensure that key generation and matching is working + ;; so that this table doesnt balloon (more than designed) + (list + (progn (clsql:sql [foo]) + (clsql:sql [foo]) + (hash-table-count clsql-sys::*output-hash*)) + + (progn (clsql:sql [foo.bar]) + (clsql:sql [foo bar]) + (hash-table-count clsql-sys::*output-hash*)) + (progn (clsql:sql (clsql-sys:sql-expression + :table (clsql-sys::database-identifier 'foo) + :attribute (clsql-sys::database-identifier 'bar))) + (clsql:sql (clsql-sys:sql-expression + :table (clsql-sys::database-identifier 'foo) + :attribute (clsql-sys::database-identifier 'bar))) + (hash-table-count clsql-sys::*output-hash*))) + (1 2 2)) + + (deftest :int/output-caching/2 + #.(locally-enable-sql-reader-syntax) + ;; ensure that we can disable the output cache and + ;; still have everything work + (let ((clsql-sys::*output-hash*)) + (list (clsql:sql [foo]) (clsql:sql [foo]) (clsql:sql [foo.bar]))) + ("FOO" "FOO" "FOO.BAR")) + ))