/ Check-in [540ce7de]
Login

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

Overview
Comment:Fix expr.test so that it works when the date-time functions are compiled out of the library. (CVS 2086)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 540ce7de1b3f1882c40d4e20d3986775e1dcf77a
User & Date: danielk1977 2004-11-10 12:34:20
Context
2004-11-10
15:27
Ensure the test suite can run with either SQLITE_OMIT_AUTOVACUUM or SQLITE_DEFAULT_AUTOVACUUM=1 defined. (CVS 2087) check-in: 0747b558 user: danielk1977 tags: trunk
12:34
Fix expr.test so that it works when the date-time functions are compiled out of the library. (CVS 2086) check-in: 540ce7de user: danielk1977 tags: trunk
11:55
Ensure tables cannot be created/dropped when btree cursors are open. (CVS 2085) check-in: 8e5c2e5d user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/expr.test.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490

491
492
493
494
495
496
497
498
499


500
501
502
503
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing expressions.
#
# $Id: expr.test,v 1.37 2004/11/09 12:44:39 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Create a table to work with.
#
execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)}
................................................................................

# Test the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP expressions.
#
set sqlite_current_time [clock seconds]
set date [clock format $sqlite_current_time -format %Y-%m-%d -gmt 1]
set time [clock format $sqlite_current_time -format %H:%M:%S -gmt 1]
do_test expr-8.1 {
  execsql {SELECT CURRENT_TIME==time('now');}
} 1
do_test expr-8.2 {
  execsql {SELECT CURRENT_TIME}
} $time
do_test expr-8.3 {
  execsql {SELECT CURRENT_DATE==date('now');}
} 1

do_test expr-8.4 {
  execsql {SELECT CURRENT_DATE}
} $date
do_test expr-8.5 {
  execsql {SELECT CURRENT_TIMESTAMP==datetime('now');}
} 1
do_test expr-8.6 {
  execsql {SELECT CURRENT_TIMESTAMP}
} [list "$date $time"]


set sqlite_current_time 0

finish_test








|







 







|
|

|
|

|
|
>
|
|
|
|
|
|
|
|
<
>
>




7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499

500
501
502
503
504
505
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing expressions.
#
# $Id: expr.test,v 1.38 2004/11/10 12:34:20 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Create a table to work with.
#
execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)}
................................................................................

# Test the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP expressions.
#
set sqlite_current_time [clock seconds]
set date [clock format $sqlite_current_time -format %Y-%m-%d -gmt 1]
set time [clock format $sqlite_current_time -format %H:%M:%S -gmt 1]
do_test expr-8.1 {
  execsql {SELECT CURRENT_TIME}
} $time
do_test expr-8.2 {
  execsql {SELECT CURRENT_DATE}
} $date
do_test expr-8.3 {
  execsql {SELECT CURRENT_TIMESTAMP}
} [list "$date $time"]
ifcapable datetime {
  do_test expr-8.4 {
    execsql {SELECT CURRENT_TIME==time('now');}
  } 1
  do_test expr-8.5 {
    execsql {SELECT CURRENT_DATE==date('now');}
  } 1
  do_test expr-8.6 {
    execsql {SELECT CURRENT_TIMESTAMP==datetime('now');}

  } 1
}
set sqlite_current_time 0

finish_test