X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=tests%2Ftest-ooddl.lisp;h=9037e53280fa1c9e5d6080996a72b227ffa06556;hp=fb4e14302015396c2ab7e4b7b6a452a0e9e40efe;hb=ad3505e2f0d71c858425e4e13b7d9d00e633ba61;hpb=90ce2284fab5f1daedb8aa6aba3008a5c3651e30 diff --git a/tests/test-ooddl.lisp b/tests/test-ooddl.lisp index fb4e143..9037e53 100644 --- a/tests/test-ooddl.lisp +++ b/tests/test-ooddl.lisp @@ -1,24 +1,23 @@ ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ====================================================================== -;;;; File: test-ooddl.lisp -;;;; Author: Marcus Pearce -;;;; Created: 30/03/2004 -;;;; Updated: $Id$ +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION ;;;; -;;;; Tests for the CLSQL Object Oriented Data Definition Language -;;;; (OODDL). +;;;; Name: test-ooddl.lisp +;;;; Purpose: Tests for the CLSQL Object Oriented Data Definition Language +;;;; Authors: Marcus Pearce and Kevin M. Rosenberg +;;;; Created: March 2004 ;;;; ;;;; This file is part of CLSQL. ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ====================================================================== +;;;; ************************************************************************* (in-package #:clsql-tests) -#.(clsql:locally-enable-sql-reader-syntax) +(clsql-sys:file-enable-sql-reader-syntax) (def-view-class big () @@ -103,15 +102,30 @@ (slot-value (employee-manager employee2) 'last-name)) "Lenin") +(deftest :ooddl/join/4 + (with-dataset *ds-employees* + (values + (length (employee-addresses employee10)) + ;; add an address + (let ((*db-auto-sync* T)) + (make-instance 'address :addressid 50) + (make-instance 'employee-address :emplid 10 :addressid 50) + ;; again + (length (employee-addresses employee10))) + (progn + (update-objects-joins (list employee10) :slots '(addresses)) + (length (employee-addresses employee10))))) + 0 0 1) + (deftest :ooddl/big/1 ;;tests that we can create-view-from-class with a bigint slot, ;; and stick a value in there. (progn (clsql-sys:create-view-from-class 'big) (values - (clsql:table-exists-p [big] :owner *test-database-user*) + (clsql:table-exists-p [big] ) (progn (clsql:drop-table [big] :if-does-not-exist :ignore) - (clsql:table-exists-p [big] :owner *test-database-user*))) + (clsql:table-exists-p [big] ))) ) t nil) @@ -185,5 +199,4 @@ )) -#.(clsql:restore-sql-reader-syntax-state)