File: tdbc.test

package info (click to toggle)
tdbc 1.1.1-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 928 kB
  • sloc: sh: 2,256; tcl: 1,146; ansic: 886; makefile: 61
file content (50 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# tdbc.test --
#
#	Tests for convenience commands in TDBC
#
# Copyright (c) 2009 by Kevin B. Kenny.
#
# $Id: $


package require tcltest 2
namespace import -force ::tcltest::*
tcltest::loadTestedCommands
package require tdbc

test tdbc-1.1 {tdbc::mapSqlState, wrong args} {*}{
     -body {
	 list [catch {tdbc::mapSqlState} result] $result
     }
    -match glob
    -result {1 {wrong # args:*}}
}

test tdbc-1.2 {tdbc::mapSqlState, wrong args} {*}{
     -body {
	 list [catch {tdbc::mapSqlState 00000 ?} result] $result
     }
    -match glob
    -result {1 {wrong # args:*}}
}

test tdbc-1.3 {tdbc::mapSqlState, known state} {*}{
    -body {
	tdbc::mapSqlState 22012
    }
    -result {DATA_EXCEPTION}
}

test tdbc-1.4 {tdbc::mapSqlState, known state} {*}{
    -body {
	tdbc::mapSqlState *****
    }
    -result {UNKNOWN_SQLSTATE}
}

cleanupTests
return

# Local Variables:
# mode: tcl
# End: