head	1.13;
access;
symbols
	core-8-5-9:1.9
	core-8-5-8:1.9
	macosx-cocoa-merge:1.13
	macosx-cocoa-premerge:1.13
	macosx-carbon-freeze:1.13
	core-8-5-7:1.9
	core-8-5-6:1.9
	core-8-6-b1:1.13
	core-8-6-a3:1.11
	core-8-5-5:1.9
	core-8-6-a2:1.10
	core-8-5-4:1.9
	core-8-5-3:1.9
	core-8-6-a1:1.9
	core-8-4-19:1.5
	core-8-5-branch:1.9.0.4
	core-8-5-2:1.9
	core-8-4-18:1.5
	core-8-5-1:1.9
	core-8-4-17:1.5
	core-8-5-0:1.9
	core-8-5-b3:1.9
	core-8-5-b2:1.9
	core-8-4-16:1.5
	core-8-5-b1:1.9
	core-stablilizer-merge:1.9
	core-stabilizer-branch:1.9.0.2
	core-stabilizer-merge:1.9
	core-8-4-15:1.5
	core-8-5-a6:1.9
	core-8-5-a5:1.9
	core-8-4-14:1.5
	core-8-5-a4:1.9
	core-8-4-13:1.5
	core-8-4-12:1.5
	core-8-4-11:1.5
	core-8-5-a3:1.9
	core-8-4-10:1.5
	core-8-4-9-branch:1.5.0.4
	core-8-5-a2:1.9
	core-8-4-9:1.5
	core-8-4-8:1.5
	core-8-4-7:1.5
	core-8-5-a1:1.7
	core-8-4-6:1.5
	core-8-4-5:1.5
	mistachkin-dev-branch:1.7.0.2
	core-8-4-4:1.5
	core-8-4-3:1.5
	core-8-4-branch:1.5.0.2
	core-8-4-2:1.5
	core-8-4-1:1.5
	core-8-3-5:1.3
	core-8-4-0:1.5
	macosx-8-4-merge-2002-08-31-trunk:1.5
	macosx-8-4-premerge-2002-08-31-branch:1.3.18.1
	macosx-8-4-premerge-2002-08-31-trunk:1.5
	macosx-8-4-merge-2002-08-30-branch:1.3.18.1
	macosx-8-4-merge-2002-08-30-trunk:1.5
	macosx-8-4-merge-2002-08-20-branch:1.3.18.1
	macosx-8-4-merge-2002-08-20-trunk:1.5
	core-8-4-b2:1.5
	core-8-4-b1:1.3
	macosx-premerge-6-9-02:1.3
	core-8-4-a4:1.3
	core-8-3-4:1.3
	macosx-8-4-branch:1.3.0.18
	macosx-8-4-branchpoint:1.3
	core-8-4-a3:1.3
	core-8-3-3:1.3
	dgp-privates-into-namespace:1.3.0.16
	tclpro-1-5-0:1.3
	core-8-4-win-speedup:1.3.0.14
	core-8-4-a2:1.3
	tclpro-1-4-1:1.3
	tclpro-1-4-0:1.3
	core-8-3-2:1.3
	ajuba-ajuba2-2-1-base:1.3
	ajuba-ajuba2-2-0:1.3
	core-8-4-a1:1.3
	core-8-3-1-branch:1.3.0.12
	core-8-3-1:1.3
	scriptics-sc-2-0-b5:1.3
	scriptics-sc-2-0-fixed:1.3
	scriptics-sc-2-0-b2:1.3
	scriptics-sc-2-0-b1:1.3
	core-8-3-0:1.3
	core-8-3-b2:1.3
	core-8-3-b1:1.3
	scriptics-sc-1-1:1.3
	scriptics-sc-1-1-b1:1.3
	core-8-2-3:1.3
	scriptics-sc-1-1-branch:1.3.0.10
	scriptics-sc-1-1-base:1.3
	scriptics-sc-1-0:1.3
	scriptics-sc-1-0-branch:1.3.0.8
	scriptics-sc-1-0-base:1.3
	core-8-2-2:1.3
	core-8-2-1:1.3
	scriptics-bc-1-0-b1:1.3
	core-8-2-1-branch:1.3.0.6
	scriptics-tclpro-1-3-0:1.3
	core-8-2-0:1.3
	core-8-2-b3-branch:1.3.0.4
	core-8-2-b3-base:1.3
	scriptics-tclpro-1-3-b4:1.3
	core-8-2-b2:1.3
	scriptics-tclpro-1-3-b3:1.3
	core-8-2-b1:1.3
	scriptics-tclpro-1-3-b2:1.3
	merge-to-mainline-5/21/99:1.3
	scriptics-tclpro-1-3-b2-branch:1.3.0.2
	core-8-1-1:1.3
	scriptics-tclpro-1-3-b1:1.3
	core-8-1-1-base:1.3
	core-8-1-0:1.3
	merge-to-mainline-4-29-99:1.3
	merge-to-mainline-4-23-99:1.3
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.6
	core-8-1-b2:1.1.4.3
	dev-8-1-stubs-branch:1.1.4.2.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.2
	core-8-0-4:1.2
	core-8-1-a2:1.1.4.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.13
date	2008.12.19.15.33.40;	author dgp;	state Exp;
branches;
next	1.12;

1.12
date	2008.12.06.09.51.55;	author dkf;	state Exp;
branches;
next	1.11;

1.11
date	2008.08.28.08.52.06;	author aniap;	state Exp;
branches;
next	1.10;

1.10
date	2008.07.23.23.24.24;	author nijtmans;	state Exp;
branches;
next	1.9;

1.9
date	2004.06.17.22.38.57;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2004.05.23.17.34.49;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2003.05.19.13.04.24;	author vincentdarley;	state Exp;
branches;
next	1.6;

1.6
date	2003.04.01.21.06.54;	author dgp;	state Exp;
branches;
next	1.5;

1.5
date	2002.07.13.20.28.35;	author dgp;	state Exp;
branches;
next	1.4;

1.4
date	2002.07.12.21.08.49;	author dgp;	state Exp;
branches;
next	1.3;

1.3
date	99.04.16.01.51.41;	author stanton;	state Exp;
branches
	1.3.18.1;
next	1.2;

1.2
date	98.09.14.18.23.51;	author stanton;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.58.18;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.29.00.25.54;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	98.09.30.02.18.59;	author stanton;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	99.03.11.18.51.12;	author hershey;	state Exp;
branches;
next	1.1.4.4;

1.1.4.4
date	99.03.24.01.17.09;	author hershey;	state Exp;
branches;
next	1.1.4.5;

1.1.4.5
date	99.03.24.02.55.04;	author hershey;	state Exp;
branches;
next	1.1.4.6;

1.1.4.6
date	99.03.26.00.08.06;	author hershey;	state Exp;
branches;
next	;

1.3.18.1
date	2002.08.20.20.27.15;	author das;	state Exp;
branches;
next	;


desc
@@


1.13
log
@        * tests/clrpick.test:   Eliminate duplicate test names.
        * tests/embed.test:
        * tests/text.test:
        * tests/textMark.test:
@
text
@# This file is a Tcl script to test the code in the file tkTextMark.c.
# This file is organized in the standard fashion for Tcl tests.
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @@(#) $Id: textMark.test,v 1.12 2008/12/06 09:51:55 dkf Exp $

package require tcltest 2.2
namespace import ::tcltest::*
tcltest::configure {*}$argv
tcltest::loadTestedCommands

destroy .t
text .t -width 20 -height 10
pack append . .t {top expand fill}
update
.t debug on
wm geometry . {}
entry .t.e

.t insert 1.0 "Line 1
abcdefghijklm
12345
Line 4
bOy GIrl .#@@? x_yz
!@@#$%
Line 7"
  
# The statements below reset the main window; it's needed if the window
# manager is mwm to make mwm forget about a previous minimum size setting.

wm withdraw .
wm minsize . 1 1
wm positionfrom . user
wm deiconify .

test textMark-1.1 {TkTextMarkCmd - missing option} -returnCodes error -body {
    .t mark
} -result {wrong # args: should be ".t mark option ?arg ...?"}
test textMark-1.2 {TkTextMarkCmd - bogus option} -returnCodes error -body {
    .t mark gorp
} -match glob -result {bad mark option "gorp": must be *}
test textMark-1.3 {TkTextMarkCmd - "gravity" option} -returnCodes error -body {
    .t mark gravity foo
} -result {there is no mark named "foo"}
test textMark-1.4 {TkTextMarkCmd - "gravity" option} -body {
    .t mark set x 1.3
    .t insert 1.3 x
    list [.t mark gravity x] [.t index x]
} -result {right 1.4}
test textMark-1.5 {TkTextMarkCmd - "gravity" option} -body {
    .t mark set x 1.3
    .t mark g x left
    .t insert 1.3 x
    list [.t mark gravity x] [.t index x]
} -result {left 1.3}
test textMark-1.6 {TkTextMarkCmd - "gravity" option} -body {
    .t mark set x 1.3
    .t mark gravity x right
    .t insert 1.3 x
    list [.t mark gravity x] [.t index x]
} -result {right 1.4}
test textMark-1.7 {TkTextMarkCmd - "gravity" option} -returnCodes error -body {
    .t mark set x 1.3
    .t mark gravity x gorp
} -result {bad mark gravity "gorp": must be left or right}
test textMark-1.8 {TkTextMarkCmd - "gravity" option} -returnCodes error -body {
    .t mark gravity
} -result {wrong # args: should be ".t mark gravity markName ?gravity?"}

test textMark-2.1 {TkTextMarkCmd - "names" option} -body {
    .t mark names 2
} -returnCodes error -result {wrong # args: should be ".t mark names"}
test textMark-2.2 {TkTextMarkCmd - "names" option} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    lsort [.t mark na]
} -result {current insert}
test textMark-2.3 {TkTextMarkCmd - "names" option} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set a 1.1
    .t mark set "b c" 2.3
    lsort [.t mark names]
} -result {a {b c} current insert}

test textMark-3.1 {TkTextMarkCmd - "set" option} -returnCodes error -body {
    .t mark set a
} -result {wrong # args: should be ".t mark set markName index"}
test textMark-3.2 {TkTextMarkCmd - "set" option} -returnCodes error -body {
    .t mark s a b c
} -result {wrong # args: should be ".t mark set markName index"}
test textMark-3.3 {TkTextMarkCmd - "set" option} -body {
    .t mark set a @@x
} -returnCodes error -result {bad text index "@@x"}
test textMark-3.4 {TkTextMarkCmd - "set" option} -body {
    .t mark set a 1.2
    .t index a
} -result 1.2
test textMark-3.5 {TkTextMarkCmd - "set" option} -body {
    .t mark set a end
    .t index a
} -result {8.0}

test textMark-4.1 {TkTextMarkCmd - "unset" option} -body {
    .t mark unset
} -result {}
test textMark-4.2 {TkTextMarkCmd - "unset" option} -body {
    .t mark set a 1.2
    .t mark set b 2.3
    .t mark unset a b
    .t index a
} -returnCodes error -result {bad text index "a"}
test textMark-4.2.1 {TkTextMarkCmd - "unset" option} -body {
    .t mark set a 1.2
    .t mark set b 2.3
    .t mark unset a b
    .t index b
} -returnCodes error -result {bad text index "b"}
test textMark-4.3 {TkTextMarkCmd - "unset" option} -body {
    .t mark set a 1.2
    .t mark set b 2.3
    .t mark set 49ers 3.1
    .t mark unset {*}[.t mark names]
    lsort [.t mark names]
} -result {current insert}

test textMark-5.1 {TkTextMarkCmd - miscellaneous} -returnCodes error -body {
    .t mark
} -result {wrong # args: should be ".t mark option ?arg ...?"}
test textMark-5.2 {TkTextMarkCmd - miscellaneous} -returnCodes error -body {
    .t mark foo
} -result {bad mark option "foo": must be gravity, names, next, previous, set, or unset}

test textMark-6.1 {TkTextMarkSegToIndex} -body {
    .t mark set a 1.2
    .t mark set b 1.2
    .t mark set c 1.2
    .t mark set d 1.4
    list [.t index a] [.t index b] [.t index c ] [.t index d]
} -result {1.2 1.2 1.2 1.4}

test textMark-7.1 {MarkFindNext - invalid mark name} -body {
    .t mark next bogus
} -returnCodes error -result {bad text index "bogus"}
test textMark-7.2 {MarkFindNext - marks at same location} -body {
    .t mark set insert 2.0
    .t mark set current 2.0
    .t mark next current
} -result {insert}
test textMark-7.3 {MarkFindNext - numerical starting mark} -body {
    .t mark set current 1.0
    .t mark set insert 1.0
    .t mark next 1.0
} -result {insert}
test textMark-7.4 {MarkFindNext - mark on the same line} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.0
    .t mark set insert 1.1
    .t mark next current
} -result {insert}
test textMark-7.5 {MarkFindNext - mark on the next line} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.end
    .t mark set insert 2.0
    .t mark next current
} -result {insert}
test textMark-7.6 {MarkFindNext - mark far away} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.2
    .t mark set insert 7.0
    .t mark next current
} -result {insert}
test textMark-7.7 {MarkFindNext - mark on top of end} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current end
    .t mark next end
} -result {current}
test textMark-7.8 {MarkFindNext - no next mark} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.0
    .t mark set insert 3.0
    .t mark next insert
} -result {}

test textMark-8.1 {MarkFindPrev - invalid mark name} -body {
    .t mark prev bogus
} -returnCodes error -result {bad text index "bogus"}
test textMark-8.2 {MarkFindPrev - marks at same location} -body {
    .t mark set insert 2.0
    .t mark set current 2.0
    .t mark prev insert
} -result {current}
test textMark-8.3 {MarkFindPrev - numerical starting mark} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.0
    .t mark set insert 1.0
    .t mark prev 1.1
} -result {current}
test textMark-8.4 {MarkFindPrev - mark on the same line} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.0
    .t mark set insert 1.1
    .t mark prev insert
} -result {current}
test textMark-8.5 {MarkFindPrev - mark on the previous line} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.end
    .t mark set insert 2.0
    .t mark prev insert
} -result {current}
test textMark-8.6 {MarkFindPrev - mark far away} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.2
    .t mark set insert 7.0
    .t mark prev insert
} -result {current}
test textMark-8.7 {MarkFindPrev - mark on top of end} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set insert 3.0
    .t mark set current end
    .t mark prev end
} -result {insert}
test textMark-8.8 {MarkFindPrev - no previous mark} -setup {
    .t mark unset {*}[.t mark names]
} -body {
    .t mark set current 1.0
    .t mark set insert 3.0
    .t mark prev current
} -result {}

destroy .t

# cleanup
cleanupTests
return

# Local Variables:
# mode: tcl
# End:
@


1.12
log
@Remove useless constraint
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.11 2008/08/28 08:52:06 aniap Exp $
d117 1
a117 1
test textMark-4.2 {TkTextMarkCmd - "unset" option} -body {
@


1.11
log
@Update to tcltest2
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.10 2008/07/23 23:24:24 nijtmans Exp $
d13 1
a13 1
eval tcltest::configure $argv
a15 1

d32 1
a32 5
testConstraint haveCourier12 [expr {[catch {
    .t configure -font {Courier 12}
}] == 0}]

# The statements below reset the main window;  it's needed if the window
d39 2
a40 5


test textMark-1.1 {TkTextMarkCmd - missing option} -constraints {
	haveCourier12 
} -body {
d42 2
a43 4
} -returnCodes error -result {wrong # args: should be ".t mark option ?arg ...?"}
test textMark-1.2 {TkTextMarkCmd - bogus option} -constraints {
	haveCourier12 
} -body {
d45 2
a46 4
} -returnCodes error -result {bad mark option "gorp": must be gravity, names, next, previous, set, or unset}
test textMark-1.3 {TkTextMarkCmd - "gravity" option} -constraints {
	haveCourier12 
} -body {
d48 2
a49 4
} -returnCodes error -result {there is no mark named "foo"}
test textMark-1.4 {TkTextMarkCmd - "gravity" option} -constraints {
	haveCourier12 
} -body {
d54 1
a54 3
test textMark-1.5 {TkTextMarkCmd - "gravity" option} -constraints {
	haveCourier12 
} -body {
d60 1
a60 3
test textMark-1.6 {TkTextMarkCmd - "gravity" option} -constraints {
	haveCourier12 
} -body {
d66 1
a66 3
test textMark-1.7 {TkTextMarkCmd - "gravity" option} -constraints {
	haveCourier12 
} -body {
d69 2
a70 4
} -returnCodes error -result {bad mark gravity "gorp": must be left or right}
test textMark-1.8 {TkTextMarkCmd - "gravity" option} -constraints {
	haveCourier12 
} -body {
d72 1
a72 2
} -returnCodes error -result {wrong # args: should be ".t mark gravity markName ?gravity?"}

d74 1
a74 3
test textMark-2.1 {TkTextMarkCmd - "names" option} -constraints {
	haveCourier12 
} -body {
d77 1
a77 3
test textMark-2.2 {TkTextMarkCmd - "names" option} -constraints {
	haveCourier12 
} -setup {
d82 1
a82 3
test textMark-2.3 {TkTextMarkCmd - "names" option} -constraints {
	haveCourier12 
} -setup {
d90 1
a90 4

test textMark-3.1 {TkTextMarkCmd - "set" option} -constraints {
	haveCourier12 
} -body {
d92 2
a93 4
} -returnCodes error -result {wrong # args: should be ".t mark set markName index"}
test textMark-3.2 {TkTextMarkCmd - "set" option} -constraints {
	haveCourier12 
} -body {
d95 2
a96 4
} -returnCodes error -result {wrong # args: should be ".t mark set markName index"}
test textMark-3.3 {TkTextMarkCmd - "set" option} -constraints {
	haveCourier12 
} -body {
d99 1
a99 3
test textMark-3.4 {TkTextMarkCmd - "set" option} -constraints {
	haveCourier12 
} -body {
d103 1
a103 3
test textMark-3.5 {TkTextMarkCmd - "set" option} -constraints {
	haveCourier12 
} -body {
d108 1
a108 4

test textMark-4.1 {TkTextMarkCmd - "unset" option} -constraints {
	haveCourier12 
} -body {
d110 2
a111 4
} -returnCodes ok -result {}
test textMark-4.2 {TkTextMarkCmd - "unset" option} -constraints {
	haveCourier12 
} -body {
d117 1
a117 3
test textMark-4.2 {TkTextMarkCmd - "unset" option} -constraints {
    haveCourier12 
} -body {
d123 1
a123 3
test textMark-4.3 {TkTextMarkCmd - "unset" option} -constraints {
	haveCourier12 
} -body {
d127 1
a127 1
    eval .t mark unset [.t mark names]
d131 1
a131 4

test textMark-5.1 {TkTextMarkCmd - miscellaneous} -constraints {
	haveCourier12 
} -body {
d133 2
a134 4
} -returnCodes error -result {wrong # args: should be ".t mark option ?arg ...?"}
test textMark-5.2 {TkTextMarkCmd - miscellaneous} -constraints {
	haveCourier12 
} -body {
d136 1
a136 1
} -returnCodes error -result {bad mark option "foo": must be gravity, names, next, previous, set, or unset}
d138 1
a138 2

test textMark-6.1 {TkTextMarkSegToIndex} -constraints haveCourier12 -body {
d146 1
a146 4

test textMark-7.1 {MarkFindNext - invalid mark name} -constraints {
	haveCourier12 
} -body {
d149 1
a149 3
test textMark-7.2 {MarkFindNext - marks at same location} -constraints {
	haveCourier12 
} -body {
d154 1
a154 3
test textMark-7.3 {MarkFindNext - numerical starting mark} -constraints {
	haveCourier12 
} -body {
d159 1
a159 3
test textMark-7.4 {MarkFindNext - mark on the same line} -constraints {
	haveCourier12 
} -setup {
d166 1
a166 3
test textMark-7.5 {MarkFindNext - mark on the next line} -constraints {
	haveCourier12 
} -setup {
d173 1
a173 3
test textMark-7.6 {MarkFindNext - mark far away} -constraints {
	haveCourier12 
} -setup {
d180 1
a180 3
test textMark-7.7 {MarkFindNext - mark on top of end} -constraints {
	haveCourier12 
} -setup {
d186 1
a186 3
test textMark-7.8 {MarkFindNext - no next mark} -constraints {
	haveCourier12 
} -setup {
d194 1
a194 4

test textMark-8.1 {MarkFindPrev - invalid mark name} -constraints {
	haveCourier12 
} -body {
d197 1
a197 3
test textMark-8.2 {MarkFindPrev - marks at same location} -constraints {
	haveCourier12 
} -body {
d202 1
a202 3
test textMark-8.3 {MarkFindPrev - numerical starting mark} -constraints {
	haveCourier12 
} -setup {
d209 1
a209 3
test textMark-8.4 {MarkFindPrev - mark on the same line} -constraints {
	haveCourier12 
} -setup {
d216 1
a216 3
test textMark-8.5 {MarkFindPrev - mark on the previous line} -constraints {
	haveCourier12 
} -setup {
d223 1
a223 3
test textMark-8.6 {MarkFindPrev - mark far away} -constraints {
	haveCourier12 
} -setup {
d230 1
a230 3
test textMark-8.7 {MarkFindPrev - mark on top of end} -constraints {
	haveCourier12 
} -setup {
d237 1
a237 3
test textMark-8.8 {MarkFindPrev - no previous mark} -constraints {
	haveCourier12 
} -setup {
d244 1
a244 1

d251 3
@


1.10
log
@fix [2021443] inconsistant "wrong # args" messages (for Tk)
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.9 2004/06/17 22:38:57 dkf Exp $
d11 2
a12 1
package require tcltest 2.1
d16 2
a17 1
catch {destroy .t}
a18 3
testConstraint haveCourier12 [expr {[catch {
    .t configure -font {Courier 12}
}] == 0}]
d23 9
d33 4
a44 8
entry .t.e
.t insert 1.0 "Line 1
abcdefghijklm
12345
Line 4
bOy GIrl .#@@? x_yz
!@@#$%
Line 7"
d46 18
a63 11
test textMark-1.1 {TkTextMarkCmd - missing option} haveCourier12 {
    list [catch {.t mark} msg] $msg
} {1 {wrong # args: should be ".t mark option ?arg ...?"}}
test textMark-1.2 {TkTextMarkCmd - bogus option} haveCourier12 {
    list [catch {.t mark gorp} msg] $msg
} {1 {bad mark option "gorp": must be gravity, names, next, previous, set, or unset}}
test textMark-1.3 {TkTextMarkCmd - "gravity" option} haveCourier12 {
    list [catch {.t mark gravity foo} msg] $msg
} {1 {there is no mark named "foo"}}
test textMark-1.4 {TkTextMarkCmd - "gravity" option} haveCourier12 {
    .t mark unset x
d67 4
a70 3
} {right 1.4}
test textMark-1.5 {TkTextMarkCmd - "gravity" option} haveCourier12 {
    .t mark unset x
d75 4
a78 3
} {left 1.3}
test textMark-1.6 {TkTextMarkCmd - "gravity" option} haveCourier12 {
    .t mark unset x
d83 24
a106 13
} {right 1.4}
test textMark-1.7 {TkTextMarkCmd - "gravity" option} haveCourier12 {
    list [catch {.t mark gravity x gorp} msg] $msg
} {1 {bad mark gravity "gorp": must be left or right}}
test textMark-1.8 {TkTextMarkCmd - "gravity" option} haveCourier12 {
    list [catch {.t mark gravity} msg] $msg
} {1 {wrong # args: should be ".t mark gravity markName ?gravity?"}}

test textMark-2.1 {TkTextMarkCmd - "names" option} haveCourier12 {
    list [catch {.t mark names 2} msg] $msg
} {1 {wrong # args: should be ".t mark names"}}
.t mark unset x
test textMark-2.2 {TkTextMarkCmd - "names" option} haveCourier12 {
d108 6
a113 2
} {current insert}
test textMark-2.3 {TkTextMarkCmd - "names" option} haveCourier12 {
d117 2
a118 1
} {a {b c} current insert}
d120 18
a137 10
test textMark-3.1 {TkTextMarkCmd - "set" option} haveCourier12 {
    list [catch {.t mark set a} msg] $msg
} {1 {wrong # args: should be ".t mark set markName index"}}
test textMark-3.2 {TkTextMarkCmd - "set" option} haveCourier12 {
    list [catch {.t mark s a b c} msg] $msg
} {1 {wrong # args: should be ".t mark set markName index"}}
test textMark-3.3 {TkTextMarkCmd - "set" option} haveCourier12 {
    list [catch {.t mark set a @@x} msg] $msg
} {1 {bad text index "@@x"}}
test textMark-3.4 {TkTextMarkCmd - "set" option} haveCourier12 {
d140 4
a143 2
} 1.2
test textMark-3.5 {TkTextMarkCmd - "set" option} haveCourier12 {
d146 1
a146 1
} {8.0}
d148 9
a156 4
test textMark-4.1 {TkTextMarkCmd - "unset" option} haveCourier12 {
    list [catch {.t mark unset} msg] $msg
} {0 {}}
test textMark-4.2 {TkTextMarkCmd - "unset" option} haveCourier12 {
d160 13
a172 3
        list [catch {.t index a} msg] $msg [catch {.t index b} msg2] $msg2
} {1 {bad text index "a"} 1 {bad text index "b"}}
test textMark-4.3 {TkTextMarkCmd - "unset" option} haveCourier12 {
d178 13
a190 1
} {current insert}
a191 6
test textMark-5.1 {TkTextMarkCmd - miscellaneous} haveCourier12 {
    list [catch {.t mark} msg] $msg
} {1 {wrong # args: should be ".t mark option ?arg ...?"}}
test textMark-5.2 {TkTextMarkCmd - miscellaneous} haveCourier12 {
    list [catch {.t mark foo} msg] $msg
} {1 {bad mark option "foo": must be gravity, names, next, previous, set, or unset}}
d193 1
a193 1
test textMark-6.1 {TkTextMarkSegToIndex} haveCourier12 {
d199 1
a199 1
} {1.2 1.2 1.2 1.4}
d201 9
a209 6
catch {eval {.t mark unset} [.t mark names]}
test textMark-7.1 {MarkFindNext - invalid mark name} haveCourier12 {
    catch {.t mark next bogus} x
    set x
} {bad text index "bogus"}
test textMark-7.2 {MarkFindNext - marks at same location} haveCourier12 {
d213 4
a216 2
} {insert}
test textMark-7.3 {MarkFindNext - numerical starting mark} haveCourier12 {
d220 6
a225 2
} {insert}
test textMark-7.4 {MarkFindNext - mark on the same line} haveCourier12 {
d229 6
a234 2
} {insert}
test textMark-7.5 {MarkFindNext - mark on the next line} haveCourier12 {
d238 6
a243 2
} {insert}
test textMark-7.6 {MarkFindNext - mark far away} haveCourier12 {
d247 6
a252 2
} {insert}
test textMark-7.7 {MarkFindNext - mark on top of end} haveCourier12 {
d255 6
a260 2
} {current}
test textMark-7.8 {MarkFindNext - no next mark} haveCourier12 {
d264 11
a274 6
} {}
test textMark-8.1 {MarkFindPrev - invalid mark name} haveCourier12 {
    catch {.t mark prev bogus} x
    set x
} {bad text index "bogus"}
test textMark-8.2 {MarkFindPrev - marks at same location} haveCourier12 {
d278 6
a283 2
} {current}
test textMark-8.3 {MarkFindPrev - numerical starting mark} haveCourier12 {
d287 6
a292 2
} {current}
test textMark-8.4 {MarkFindPrev - mark on the same line} haveCourier12 {
d296 6
a301 2
} {current}
test textMark-8.5 {MarkFindPrev - mark on the previous line} haveCourier12 {
d305 6
a310 2
} {current}
test textMark-8.6 {MarkFindPrev - mark far away} haveCourier12 {
d314 6
a319 2
} {current}
test textMark-8.7 {MarkFindPrev - mark on top of end} haveCourier12 {
d323 6
a328 2
} {insert}
test textMark-8.8 {MarkFindPrev - no previous mark} haveCourier12 {
d332 1
a332 1
} {}
d334 1
a334 1
catch {destroy .t}
d339 1
@


1.9
log
@Steps towards systematization of test constraints in Tk test suite
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.8 2004/05/23 17:34:49 dkf Exp $
d44 1
a44 1
} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}}
d128 1
a128 1
} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}}
@


1.8
log
@First step towards improving test style.  Also start using Tcl 8.5 features.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.7 2003/05/19 13:04:24 vincentdarley Exp $
d16 4
a19 3
testConstraint courier12 [expr {[catch {
				text .t -font {Courier 12} -width 20 -height 10
				}] == 0}]
d42 1
a42 1
test textMark-1.1 {TkTextMarkCmd - missing option} courier12 {
d45 1
a45 1
test textMark-1.2 {TkTextMarkCmd - bogus option} courier12 {
d48 1
a48 1
test textMark-1.3 {TkTextMarkCmd - "gravity" option} courier12 {
d51 1
a51 1
test textMark-1.4 {TkTextMarkCmd - "gravity" option} courier12 {
d57 1
a57 1
test textMark-1.5 {TkTextMarkCmd - "gravity" option} courier12 {
d64 1
a64 1
test textMark-1.6 {TkTextMarkCmd - "gravity" option} courier12 {
d71 1
a71 1
test textMark-1.7 {TkTextMarkCmd - "gravity" option} courier12 {
d74 1
a74 1
test textMark-1.8 {TkTextMarkCmd - "gravity" option} courier12 {
d78 1
a78 1
test textMark-2.1 {TkTextMarkCmd - "names" option} courier12 {
d82 1
a82 1
test textMark-2.2 {TkTextMarkCmd - "names" option} courier12 {
d85 1
a85 1
test textMark-2.3 {TkTextMarkCmd - "names" option} courier12 {
d91 1
a91 1
test textMark-3.1 {TkTextMarkCmd - "set" option} courier12 {
d94 1
a94 1
test textMark-3.2 {TkTextMarkCmd - "set" option} courier12 {
d97 1
a97 1
test textMark-3.3 {TkTextMarkCmd - "set" option} courier12 {
d100 1
a100 1
test textMark-3.4 {TkTextMarkCmd - "set" option} courier12 {
d104 1
a104 1
test textMark-3.5 {TkTextMarkCmd - "set" option} courier12 {
d109 1
a109 1
test textMark-4.1 {TkTextMarkCmd - "unset" option} courier12 {
d112 1
a112 1
test textMark-4.2 {TkTextMarkCmd - "unset" option} courier12 {
d118 1
a118 1
test textMark-4.3 {TkTextMarkCmd - "unset" option} courier12 {
d126 1
a126 1
test textMark-5.1 {TkTextMarkCmd - miscellaneous} courier12 {
d129 1
a129 1
test textMark-5.2 {TkTextMarkCmd - miscellaneous} courier12 {
d133 1
a133 1
test textMark-6.1 {TkTextMarkSegToIndex} courier12 {
d142 1
a142 1
test textMark-7.1 {MarkFindNext - invalid mark name} courier12 {
d146 1
a146 1
test textMark-7.2 {MarkFindNext - marks at same location} courier12 {
d151 1
a151 1
test textMark-7.3 {MarkFindNext - numerical starting mark} courier12 {
d156 1
a156 1
test textMark-7.4 {MarkFindNext - mark on the same line} courier12 {
d161 1
a161 1
test textMark-7.5 {MarkFindNext - mark on the next line} courier12 {
d166 1
a166 1
test textMark-7.6 {MarkFindNext - mark far away} courier12 {
d171 1
a171 1
test textMark-7.7 {MarkFindNext - mark on top of end} courier12 {
d175 1
a175 1
test textMark-7.8 {MarkFindNext - no next mark} courier12 {
d180 1
a180 1
test textMark-8.1 {MarkFindPrev - invalid mark name} courier12 {
d184 1
a184 1
test textMark-8.2 {MarkFindPrev - marks at same location} courier12 {
d189 1
a189 1
test textMark-8.3 {MarkFindPrev - numerical starting mark} courier12 {
d194 1
a194 1
test textMark-8.4 {MarkFindPrev - mark on the same line} courier12 {
d199 1
a199 1
test textMark-8.5 {MarkFindPrev - mark on the previous line} courier12 {
d204 1
a204 1
test textMark-8.6 {MarkFindPrev - mark far away} courier12 {
d209 1
a209 1
test textMark-8.7 {MarkFindPrev - mark on top of end} courier12 {
d214 1
a214 1
test textMark-8.8 {MarkFindPrev - no previous mark} courier12 {
@


1.7
log
@tip 113 implementation
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.6 2003/04/01 21:06:54 dgp Exp $
a223 13













@


1.6
log
@        * tests/all.tcl:                Made better use of a common
        * tests/constraints.tcl:        -loadfile to hold definitions
        * tests/*.test:                 common to all test files.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.5 2002/07/13 20:28:35 dgp Exp $
d82 1
a82 1
    lsort [.t mark n]
@


1.5
log
@	* Converted more files to tcltest and factored out common code.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.4 2002/07/12 21:08:49 dgp Exp $
d12 1
a12 4
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
d222 1
a222 1
::tcltest::cleanupTests
@


1.4
log
@	* Converted several files in the Tk test suite for testing by
	tcltest 2.1.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.3 1999/04/16 01:51:41 stanton Exp $
d12 5
a16 3
namespace import -force tcltest::test
namespace import -force tcltest::testConstraint
eval tcltest::configure $argv
@


1.3
log
@* Merged 8.1 branch into the main trunk
@
text
@d9 1
a9 1
# RCS: @@(#) $Id$
d11 4
a14 3
if {[lsearch [namespace children] ::tcltest] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}
d17 3
a19 6
if [catch {text .t -font {Courier 12} -width 20 -height 10}] {
    puts "The font needed by these tests isn't available, so I'm"
    puts "going to skip the tests."
    ::tcltest::cleanupTests
    return
}
d42 1
a42 1
test textMark-1.1 {TkTextMarkCmd - missing option} {
d45 1
a45 1
test textMark-1.2 {TkTextMarkCmd - bogus option} {
d48 1
a48 1
test textMark-1.3 {TkTextMarkCmd - "gravity" option} {
d51 1
a51 1
test textMark-1.4 {TkTextMarkCmd - "gravity" option} {
d57 1
a57 1
test textMark-1.5 {TkTextMarkCmd - "gravity" option} {
d64 1
a64 1
test textMark-1.6 {TkTextMarkCmd - "gravity" option} {
d71 1
a71 1
test textMark-1.7 {TkTextMarkCmd - "gravity" option} {
d74 1
a74 1
test textMark-1.8 {TkTextMarkCmd - "gravity" option} {
d78 1
a78 1
test textMark-2.1 {TkTextMarkCmd - "names" option} {
d82 1
a82 1
test textMark-2.2 {TkTextMarkCmd - "names" option} {
d85 1
a85 1
test textMark-2.3 {TkTextMarkCmd - "names" option} {
d91 1
a91 1
test textMark-3.1 {TkTextMarkCmd - "set" option} {
d94 1
a94 1
test textMark-3.2 {TkTextMarkCmd - "set" option} {
d97 1
a97 1
test textMark-3.3 {TkTextMarkCmd - "set" option} {
d100 1
a100 1
test textMark-3.4 {TkTextMarkCmd - "set" option} {
d104 1
a104 1
test textMark-3.5 {TkTextMarkCmd - "set" option} {
d109 1
a109 1
test textMark-4.1 {TkTextMarkCmd - "unset" option} {
d112 1
a112 1
test textMark-4.2 {TkTextMarkCmd - "unset" option} {
d118 1
a118 1
test textMark-4.3 {TkTextMarkCmd - "unset" option} {
d126 1
a126 1
test textMark-5.1 {TkTextMarkCmd - miscellaneous} {
d129 1
a129 1
test textMark-5.2 {TkTextMarkCmd - miscellaneous} {
d133 1
a133 1
test textMark-6.1 {TkTextMarkSegToIndex} {
d142 1
a142 1
test textMark-7.1 {MarkFindNext - invalid mark name} {
d146 1
a146 1
test textMark-7.2 {MarkFindNext - marks at same location} {
d151 1
a151 1
test textMark-7.3 {MarkFindNext - numerical starting mark} {
d156 1
a156 1
test textMark-7.4 {MarkFindNext - mark on the same line} {
d161 1
a161 1
test textMark-7.5 {MarkFindNext - mark on the next line} {
d166 1
a166 1
test textMark-7.6 {MarkFindNext - mark far away} {
d171 1
a171 1
test textMark-7.7 {MarkFindNext - mark on top of end} {
d175 1
a175 1
test textMark-7.8 {MarkFindNext - no next mark} {
d180 1
a180 1
test textMark-8.1 {MarkFindPrev - invalid mark name} {
d184 1
a184 1
test textMark-8.2 {MarkFindPrev - marks at same location} {
d189 1
a189 1
test textMark-8.3 {MarkFindPrev - numerical starting mark} {
d194 1
a194 1
test textMark-8.4 {MarkFindPrev - mark on the same line} {
d199 1
a199 1
test textMark-8.5 {MarkFindPrev - mark on the previous line} {
d204 1
a204 1
test textMark-8.6 {MarkFindPrev - mark far away} {
d209 1
a209 1
test textMark-8.7 {MarkFindPrev - mark on top of end} {
d214 1
a214 1
test textMark-8.8 {MarkFindPrev - no previous mark} {
@


1.3.18.1
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d11 3
a13 6
package require tcltest 2.1
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
tcltest::loadTestedCommands
d16 6
a21 3
testConstraint courier12 [expr {[catch {
				text .t -font {Courier 12} -width 20 -height 10
				}] == 0}]
d44 1
a44 1
test textMark-1.1 {TkTextMarkCmd - missing option} courier12 {
d47 1
a47 1
test textMark-1.2 {TkTextMarkCmd - bogus option} courier12 {
d50 1
a50 1
test textMark-1.3 {TkTextMarkCmd - "gravity" option} courier12 {
d53 1
a53 1
test textMark-1.4 {TkTextMarkCmd - "gravity" option} courier12 {
d59 1
a59 1
test textMark-1.5 {TkTextMarkCmd - "gravity" option} courier12 {
d66 1
a66 1
test textMark-1.6 {TkTextMarkCmd - "gravity" option} courier12 {
d73 1
a73 1
test textMark-1.7 {TkTextMarkCmd - "gravity" option} courier12 {
d76 1
a76 1
test textMark-1.8 {TkTextMarkCmd - "gravity" option} courier12 {
d80 1
a80 1
test textMark-2.1 {TkTextMarkCmd - "names" option} courier12 {
d84 1
a84 1
test textMark-2.2 {TkTextMarkCmd - "names" option} courier12 {
d87 1
a87 1
test textMark-2.3 {TkTextMarkCmd - "names" option} courier12 {
d93 1
a93 1
test textMark-3.1 {TkTextMarkCmd - "set" option} courier12 {
d96 1
a96 1
test textMark-3.2 {TkTextMarkCmd - "set" option} courier12 {
d99 1
a99 1
test textMark-3.3 {TkTextMarkCmd - "set" option} courier12 {
d102 1
a102 1
test textMark-3.4 {TkTextMarkCmd - "set" option} courier12 {
d106 1
a106 1
test textMark-3.5 {TkTextMarkCmd - "set" option} courier12 {
d111 1
a111 1
test textMark-4.1 {TkTextMarkCmd - "unset" option} courier12 {
d114 1
a114 1
test textMark-4.2 {TkTextMarkCmd - "unset" option} courier12 {
d120 1
a120 1
test textMark-4.3 {TkTextMarkCmd - "unset" option} courier12 {
d128 1
a128 1
test textMark-5.1 {TkTextMarkCmd - miscellaneous} courier12 {
d131 1
a131 1
test textMark-5.2 {TkTextMarkCmd - miscellaneous} courier12 {
d135 1
a135 1
test textMark-6.1 {TkTextMarkSegToIndex} courier12 {
d144 1
a144 1
test textMark-7.1 {MarkFindNext - invalid mark name} courier12 {
d148 1
a148 1
test textMark-7.2 {MarkFindNext - marks at same location} courier12 {
d153 1
a153 1
test textMark-7.3 {MarkFindNext - numerical starting mark} courier12 {
d158 1
a158 1
test textMark-7.4 {MarkFindNext - mark on the same line} courier12 {
d163 1
a163 1
test textMark-7.5 {MarkFindNext - mark on the next line} courier12 {
d168 1
a168 1
test textMark-7.6 {MarkFindNext - mark far away} courier12 {
d173 1
a173 1
test textMark-7.7 {MarkFindNext - mark on top of end} courier12 {
d177 1
a177 1
test textMark-7.8 {MarkFindNext - no next mark} courier12 {
d182 1
a182 1
test textMark-8.1 {MarkFindPrev - invalid mark name} courier12 {
d186 1
a186 1
test textMark-8.2 {MarkFindPrev - marks at same location} courier12 {
d191 1
a191 1
test textMark-8.3 {MarkFindPrev - numerical starting mark} courier12 {
d196 1
a196 1
test textMark-8.4 {MarkFindPrev - mark on the same line} courier12 {
d201 1
a201 1
test textMark-8.5 {MarkFindPrev - mark on the previous line} courier12 {
d206 1
a206 1
test textMark-8.6 {MarkFindPrev - mark far away} courier12 {
d211 1
a211 1
test textMark-8.7 {MarkFindPrev - mark on top of end} courier12 {
d216 1
a216 1
test textMark-8.8 {MarkFindPrev - no previous mark} courier12 {
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d6 2
a7 3
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
d11 3
a13 2
if {[string compare test [info procs test]] == 1} then \
  {source defs}
d19 1
d223 17
a239 1
concat {}
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
# SCCS: @@(#) textMark.test 1.8 97/10/20 11:13:00
@


1.1.4.1
log
@initial tk8.1a2 version
@
text
@d10 1
a10 1
# SCCS: @@(#) textMark.test 1.9 98/01/12 12:45:56
@


1.1.4.2
log
@Merged 8.0.3 changes into 8.1
@
text
@d10 1
a10 1
# RCS: @@(#) $Id: textMark.test,v 1.2 1998/09/14 18:23:51 stanton Exp $
@


1.1.4.3
log
@Updated the testsuite to use "test" namespace and commandline args
to control verbose  level and which tests get run.  Tests now work from
any working dir.
@
text
@a5 2
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
d7 4
a10 1
# RCS: @@(#) $Id: textMark.test,v 1.1.4.2 1998/09/30 02:18:59 stanton Exp $
d12 2
a13 3
if {[lsearch [namespace children] ::test] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}
d222 1
a222 4

# cleanup
::test::cleanupTests
return
@


1.1.4.4
log
@- changed ::test to ::tcltest
- made many tests more atomic (still more work to do here)
- defs.tcl is now identicle for tcl and tk
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.1.4.3 1999/03/11 18:51:12 hershey Exp $
d11 1
a11 1
if {[lsearch [namespace children] ::tcltest] == -1} {
d224 1
a224 1
::tcltest::cleanupTests
a225 12












@


1.1.4.5
log
@lint:  changed a tcltest namespace variable name from tmpDir to
       workingDir.
changes:  made more tests atomic.
README is now updated to match new test suite features.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.1.4.4 1999/03/24 01:17:09 hershey Exp $
a225 1

@


1.1.4.6
log
@Now all test files that skip tests by returning early (which ideally they
shouldn't do) call ::tcltest::cleanupTests before returning.  The defs.tcl
file has one hew constraint:  userInteraction, used by tests that require
user interaction.  The next putback will include an updated version of the
"visual" test file to use this mechanism.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: textMark.test,v 1.1.4.5 1999/03/24 02:55:04 hershey Exp $
a18 1
    ::tcltest::cleanupTests
@


