/ Check-in [3ef95d5f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved test coverage for update.c. (CVS 2214)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3ef95d5fe98e7451f8b87b3f5259163f3e7d0289
User & Date: drh 2005-01-15 00:40:43
Context
2005-01-15
01:52
Test coverage improvements. (CVS 2215) check-in: 92f9d2b2 user: drh tags: trunk
00:40
Improved test coverage for update.c. (CVS 2214) check-in: 3ef95d5f user: drh tags: trunk
00:36
Improved coverage for insert.c. (CVS 2213) check-in: 997d8aff user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/update.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the UPDATE statement.
    13     13   #
    14         -# $Id: update.test,v 1.15 2004/02/10 13:41:53 drh Exp $
           14  +# $Id: update.test,v 1.16 2005/01/15 00:40:43 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Try to update an non-existent table
    20     20   #
    21     21   do_test update-1.1 {
................................................................................
   554    554       UPDATE t2 SET rowid=rowid-1;
   555    555       SELECT count(*) FROM t2 WHERE a=rowid+1;
   556    556     }
   557    557   } 16384
   558    558   
   559    559   integrity_check update-13.6
   560    560   
          561  +ifcapable {trigger} {
          562  +# Test for proper detection of malformed WHEN clauses on UPDATE triggers.
          563  +#
          564  +do_test update-14.1 {
          565  +  execsql {
          566  +    CREATE TABLE t3(a,b,c);
          567  +    CREATE TRIGGER t3r1 BEFORE UPDATE on t3 WHEN nosuchcol BEGIN
          568  +      SELECT 'illegal WHEN clause';
          569  +    END;
          570  +  }
          571  +} {}
          572  +do_test update-14.2 {
          573  +  catchsql {
          574  +    UPDATE t3 SET a=1;
          575  +  }
          576  +} {1 {no such column: nosuchcol}}
          577  +do_test update-14.3 {
          578  +  execsql {
          579  +    CREATE TABLE t4(a,b,c);
          580  +    CREATE TRIGGER t4r1 AFTER UPDATE on t4 WHEN nosuchcol BEGIN
          581  +      SELECT 'illegal WHEN clause';
          582  +    END;
          583  +  }
          584  +} {}
          585  +do_test update-14.4 {
          586  +  catchsql {
          587  +    UPDATE t4 SET a=1;
          588  +  }
          589  +} {1 {no such column: nosuchcol}}
          590  +
          591  +} ;# ifcapable {trigger}
          592  +
   561    593   
   562    594   finish_test