summaryrefslogtreecommitdiffstats
path: root/tests/tk.test
blob: bfd0cf8986a47c12c42924126882e51c76644cfa (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# This file is a Tcl script to test the tk command.
# It is organized in the standard fashion for Tcl tests.
#
# Copyright (c) 1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id: tk.test,v 1.4 1999/12/16 21:58:29 hobbs Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}

test tk-1.1 {tk command: general} {
    list [catch {tk} msg] $msg
} {1 {wrong # args: should be "tk option ?arg?"}}
test tk-1.2 {tk command: general} {
    list [catch {tk xyz} msg] $msg
} {1 {bad option "xyz": must be appname, scaling, or useinputmethods}}

set appname [tk appname]
test tk-2.1 {tk command: appname} {
    list [catch {tk appname xyz abc} msg] $msg
} {1 {wrong # args: should be "tk appname ?newName?"}}
test tk-2.2 {tk command: appname} {
    tk appname foobazgarply
} {foobazgarply}
test tk-2.3 {tk command: appname} {unixOnly} {
    tk appname bazfoogarply
    expr {[lsearch -exact [winfo interps] [tk appname]] >= 0}
} {1}
test tk-2.4 {tk command: appname} {
    tk appname $appname
} $appname
tk appname $appname

set scaling [tk scaling]
test tk-3.1 {tk command: scaling} {
    list [catch {tk scaling -displayof} msg] $msg
} {1 {value for "-displayof" missing}}
test tk-3.2 {tk command: scaling: get current} {
    tk scaling 1
    format %.2g [tk scaling]
} 1
test tk-3.3 {tk command: scaling: get current} {
    tk scaling -displayof . 1.25
    format %.3g [tk scaling]
} 1.25
test tk-3.4 {tk command: scaling: set new} {
    list [catch {tk scaling xyz} msg] $msg
} {1 {expected floating-point number but got "xyz"}}
test tk-3.5 {tk command: scaling: set new} {
    list [catch {tk scaling -displayof . xyz} msg] $msg
} {1 {expected floating-point number but got "xyz"}}
test tk-3.6 {tk command: scaling: set new} {
    tk scaling 1
    format %.2g [tk scaling]
} 1
test tk-3.7 {tk command: scaling: set new} {
    tk scaling -displayof . 1.25
    format %.3g [tk scaling]
} 1.25
test tk-3.8 {tk command: scaling: negative} {
    tk scaling -1
    expr {[tk scaling] > 0}
} {1}
test tk-3.9 {tk command: scaling: too big} {
    tk scaling 1000000
    expr {[tk scaling] < 10000}
} {1}    
test tk-3.10 {tk command: scaling: widthmm} {
    tk scaling 1.25
    expr {int((25.4*[winfo screenwidth .])/(72*1.25)+0.5)-[winfo screenmmwidth .]}
} {0}
test tk-3.11 {tk command: scaling: heightmm} {
    tk scaling 1.25
    expr {int((25.4*[winfo screenheight .])/(72*1.25)+0.5)-[winfo screenmmheight .]}
} {0}
tk scaling $scaling

set useim [tk useinputmethods]
test tk-4.1 {tk command: useinputmethods} {
    list [catch {tk useinputmethods -displayof} msg] $msg
} {1 {value for "-displayof" missing}}
test tk-4.2 {tk command: useinputmethods: get current} {
    tk useinputmethods no
} 0
test tk-4.3 {tk command: useinputmethods: get current} {
    tk useinputmethods -displayof .
} 0
test tk-4.4 {tk command: useinputmethods: set new} {
    list [catch {tk useinputmethods xyz} msg] $msg
} {1 {expected boolean value but got "xyz"}}
test tk-4.5 {tk command: useinputmethods: set new} {
    list [catch {tk useinputmethods -displayof . xyz} msg] $msg
} {1 {expected boolean value but got "xyz"}}
test tk-4.6 {tk command: useinputmethods: set new} {unixOnly} {
    # This isn't really a test, but more of a check...
    # The answer is what was given, because we may be on a Unix
    # system that doesn't have the XIM stuff
    if {[tk useinputmethods 1] == 0} {
	puts "this wish doesn't have XIM (X Input Methods) support"
    }
    # We should always start with XIM support off
    set useim
} 0
test tk-4.7 {tk command: useinputmethods: set new} {macOrPc} {
    # Mac and Windows don't have X Input Methods, so this should
    # always return 0
    tk useinputmethods 1
} 0
tk useinputmethods $useim

# cleanup
::tcltest::cleanupTests
return
ub Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-04-06 22:25:46 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-04-06 22:25:46 (GMT)
commitda705965dccc8a0dd3cb919814226e0c4ec0385c (patch)
treef364fcb944511bb8790be7882532203c0195be6b /generic/tclFileName.c
parent7bf9dfccb2afbac70ebc42a88d57741b4a2df416 (diff)
downloadtcl-da705965dccc8a0dd3cb919814226e0c4ec0385c.zip
tcl-da705965dccc8a0dd3cb919814226e0c4ec0385c.tar.gz
tcl-da705965dccc8a0dd3cb919814226e0c4ec0385c.tar.bz2
Patch 922727 committed. Implements three changes:
* generic/tclInt.h: Reworked the Tcl header files into a clean * unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h * win/tclWinInt.h: and every C source file should #include * win/tclWinPort.h: at most one of those files to satisfy its declaration needs. tclWinInt.h and tclWinPort.h also better organized so that tclWinPort.h includes the Windows implementation of cross-platform declarations, while tclWinInt.h makes declarations that are available on Windows only. * generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h * generic/tclMath.h (removed): header file. The internal Tcl * macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a * win/tcl.dsp: #include <math.h> directly, and file external to Tcl needing libm should do the same. * win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file. * win/makefile.bc (TCLOBJS): It's a vestige from matherr() days * win/makefile.vc (TCLOBJS): gone by. * win/tcl.dsp: * win/tclWinMtherr.c (removed):
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 60f234d..33f6f52 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -10,11 +10,10 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclFileName.c,v 1.52 2004/03/30 16:13:57 dgp Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.53 2004/04/06 22:25:51 dgp Exp $
*/
#include "tclInt.h"
-#include "tclPort.h"
#include "tclRegexp.h"
#include "tclFileSystem.h" /* For TclGetPathType() */