SQLite

Check-in [c9a734406c]
Login

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

Overview
Comment:Enhance the do_test proc in the test suite so that if the expected result is of the form "/.../" or "~/.../" then regular expression matching is done between result and the "..." part of the expectation. In the ~/.../ case, we expect there to be no match.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c9a734406c016329e80d887f7438206e41c52ce7
User & Date: drh 2012-04-27 01:08:02.413
Context
2012-04-27
01:09
Enhance the processing of ORDER BY clauses on compound queries to better match terms of the order by against expressions in the result set, in order to enable better query optimization. (check-in: a49e909c87 user: drh tags: trunk)
01:08
Enhance the do_test proc in the test suite so that if the expected result is of the form "/.../" or "~/.../" then regular expression matching is done between result and the "..." part of the expectation. In the ~/.../ case, we expect there to be no match. (check-in: c9a734406c user: drh tags: trunk)
2012-04-26
22:47
Allow virtual table constructors to be invoked recursively. A test case for this has been added to TH3. (check-in: 696a5a40bb user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/tester.tcl.
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
  set_test_counter count [expr [set_test_counter count] + 1]
}


# Invoke the do_test procedure to run a single test 
#
proc do_test {name cmd expected} {

  global argv cmdlinearg

  fix_testname name

  sqlite3_memdebug_settitle $name

#  if {[llength $argv]==0} { 







<







470
471
472
473
474
475
476

477
478
479
480
481
482
483
  set_test_counter count [expr [set_test_counter count] + 1]
}


# Invoke the do_test procedure to run a single test 
#
proc do_test {name cmd expected} {

  global argv cmdlinearg

  fix_testname name

  sqlite3_memdebug_settitle $name

#  if {[llength $argv]==0} { 
501
502
503
504
505
506
507










508


509
510
511
512

513
514
515
516
517
518
519
  puts -nonewline $name...
  flush stdout

  if {![info exists ::G(match)] || [string match $::G(match) $name]} {
    if {[catch {uplevel #0 "$cmd;\n"} result]} {
      puts "\nError: $result"
      fail_test $name










    } elseif {[string compare $result $expected]} {


      puts "\nExpected: \[$expected\]\n     Got: \[$result\]"
      fail_test $name
    } else {
      puts " Ok"

    }
  } else {
    puts " Omitted"
    omit_test $name "pattern mismatch" 0
  }
  flush stdout
}







>
>
>
>
>
>
>
>
>
>
|
>
>
|
|
|
|
>







500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
  puts -nonewline $name...
  flush stdout

  if {![info exists ::G(match)] || [string match $::G(match) $name]} {
    if {[catch {uplevel #0 "$cmd;\n"} result]} {
      puts "\nError: $result"
      fail_test $name
    } else {
      if {[regexp {^~?/.*/$} $expected]} {
        if {[string index $expected 0]=="~"} {
          set re [string range $expected 2 end-1]
          set ok [expr {![regexp $re $result]}]
        } else {
          set re [string range $expected 1 end-1]
          set ok [regexp $re $result]
        }
      } else {
        set ok [expr {[string compare $result $expected]==0}]
      }
      if {!$ok} {
        puts "\nExpected: \[$expected\]\n     Got: \[$result\]"
        fail_test $name
      } else {
        puts " Ok"
      }
    }
  } else {
    puts " Omitted"
    omit_test $name "pattern mismatch" 0
  }
  flush stdout
}