summaryrefslogtreecommitdiffstats
path: root/tests/scrollbar.test
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2008-10-06 23:42:58 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2008-10-06 23:42:58 (GMT)
commite0b0b949f2dd493f17925e7318a7e4f9854fae27 (patch)
tree346d568a650994ebd3164cbb0d1c1b4ccd9bff9b /tests/scrollbar.test
parent9179ac5d7ee1093c15e0cdf76142cc7eb1a10bf4 (diff)
downloadtk-e0b0b949f2dd493f17925e7318a7e4f9854fae27.zip
tk-e0b0b949f2dd493f17925e7318a7e4f9854fae27.tar.gz
tk-e0b0b949f2dd493f17925e7318a7e4f9854fae27.tar.bz2
Removed dependency on default precision
Diffstat (limited to 'tests/scrollbar.test')
-rw-r--r--tests/scrollbar.test31
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 5c567c6..33fd592 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: scrollbar.test,v 1.21 2008/07/23 23:24:26 nijtmans Exp $
+# RCS: @(#) $Id: scrollbar.test,v 1.22 2008/10/06 23:42:58 patthoyts Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -216,13 +216,13 @@ test scrollbar-3.24 {ScrollbarWidgetCmd procedure, "delta" option} {
list [catch {.s delta 18 xxyz} msg] $msg
} {1 {expected integer but got "xxyz"}}
test scrollbar-3.25 {ScrollbarWidgetCmd procedure, "delta" option} {
- .s delta 20 0
+ format {%.6g} [.s delta 20 0]
} {0}
test scrollbar-3.26 {ScrollbarWidgetCmd procedure, "delta" option} {
- .s delta 0 20
+ format {%.6g} [.s delta 0 20]
} [format %.6g [expr 20.0/([getTroughSize .s]-1)]]
test scrollbar-3.27 {ScrollbarWidgetCmd procedure, "delta" option} {
- .s delta 0 -20
+ format {%.6g} [.s delta 0 -20]
} [format %.6g [expr -20.0/([getTroughSize .s]-1)]]
test scrollbar-3.28 {ScrollbarWidgetCmd procedure, "delta" option} {
toplevel .t -width 250 -height 100
@@ -230,8 +230,8 @@ test scrollbar-3.28 {ScrollbarWidgetCmd procedure, "delta" option} {
scrollbar .t.s -orient horizontal -borderwidth 2
place .t.s -width 201
update
- set result [list [.t.s delta 0 20] \
- [.t.s delta [expr [getTroughSize .t.s] - 1] 0]]
+ set result [list [format {%.6g} [.t.s delta 0 20]] \
+ [format {%.6g} [.t.s delta [expr [getTroughSize .t.s] - 1] 0]]]
destroy .t
set result
} {0 1}
@@ -248,26 +248,27 @@ test scrollbar-3.32 {ScrollbarWidgetCmd procedure, "fraction" option} {
list [catch {.s fraction 24 bogus} msg] $msg
} {1 {expected integer but got "bogus"}}
test scrollbar-3.33 {ScrollbarWidgetCmd procedure, "fraction" option} {
- .s fraction 0 0
+ format {%.6g} [.s fraction 0 0]
} {0}
test scrollbar-3.34 {ScrollbarWidgetCmd procedure, "fraction" option} {
- .s fraction 0 1000
+ format {%.6g} [.s fraction 0 1000]
} {1}
test scrollbar-3.35 {ScrollbarWidgetCmd procedure, "fraction" option} {
- .s fraction 4 21
+ format {%.6g} [.s fraction 4 21]
} [format %.6g [expr (21.0 - ([winfo height .s] - [getTroughSize .s])/2.0) \
/([getTroughSize .s] - 1)]]
test scrollbar-3.36 {ScrollbarWidgetCmd procedure, "fraction" option} unix {
- .s fraction 4 179
+ format {%.6g} [.s fraction 4 179]
} {1}
test scrollbar-3.37 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics} {
- .s fraction 4 [expr 200 - [testmetrics cyvscroll .s]]
+ format {%.6g} [.s fraction 4 [expr 200 - [testmetrics cyvscroll .s]]]
} {1}
test scrollbar-3.38 {ScrollbarWidgetCmd procedure, "fraction" option} unix {
- .s fraction 4 178
+ format {%.6g} [.s fraction 4 178]
} {0.993711}
test scrollbar-3.39 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics win} {
- expr [.s fraction 4 [expr 200 - [testmetrics cyvscroll .s] - 2]] \
+ expr \
+ [format {%.6g} [.s fraction 4 [expr 200 - [testmetrics cyvscroll .s] - 2]]] \
== [format %g [expr (200.0 - [testmetrics cyvscroll .s]*2 - 2) \
/ ($height - 1 - [testmetrics cyvscroll .s]*2)]]
} 1
@@ -279,7 +280,7 @@ place .t.s -width 201
update
test scrollbar-3.41 {ScrollbarWidgetCmd procedure, "fraction" option} {
- .t.s fraction 100 0
+ format {%.6g} [.t.s fraction 100 0]
} {0.5}
if {[testConstraint testmetrics]} {
place configure .t.s -width [expr 2*[testmetrics cxhscroll .t.s]+1]
@@ -288,7 +289,7 @@ if {[testConstraint testmetrics]} {
}
update
test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} {
- .t.s fraction 100 0
+ format {%.6g} [.t.s fraction 100 0]
} {0}
destroy .t
test scrollbar-3.43 {ScrollbarWidgetCmd procedure, "get" option} {