OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tcl8.6.12 / pkgs / tdbc1.1.3 / tests / tdbc.test
1 # tdbc.test --
2 #
3 #       Tests for convenience commands in TDBC
4 #
5 # Copyright (c) 2009 by Kevin B. Kenny.
6 #
7 # $Id: $
8
9
10 package require tcltest 2
11 namespace import -force ::tcltest::*
12 tcltest::loadTestedCommands
13 package require tdbc
14
15 test tdbc-1.1 {tdbc::mapSqlState, wrong args} {*}{
16      -body {
17          list [catch {tdbc::mapSqlState} result] $result
18      }
19     -match glob
20     -result {1 {wrong # args:*}}
21 }
22
23 test tdbc-1.2 {tdbc::mapSqlState, wrong args} {*}{
24      -body {
25          list [catch {tdbc::mapSqlState 00000 ?} result] $result
26      }
27     -match glob
28     -result {1 {wrong # args:*}}
29 }
30
31 test tdbc-1.3 {tdbc::mapSqlState, known state} {*}{
32     -body {
33         tdbc::mapSqlState 22012
34     }
35     -result {DATA_EXCEPTION}
36 }
37
38 test tdbc-1.4 {tdbc::mapSqlState, known state} {*}{
39     -body {
40         tdbc::mapSqlState *****
41     }
42     -result {UNKNOWN_SQLSTATE}
43 }
44
45 cleanupTests
46 return
47
48 # Local Variables:
49 # mode: tcl
50 # End: