author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 14 Jun 2018 22:19:39 +0100 | |
branch | jv |
changeset 18227 | d25a407ba86d |
parent 18226 | 346376844040 |
child 18532 | cccb41254edf |
permissions | -rw-r--r-- |
10026 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
18226 | 3 |
COPYRIGHT (c) 2015 Jan Vrany |
10026 | 4 |
All Rights Reserved |
5 |
||
6 |
This software is furnished under a license and may be used |
|
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
13 |
"{ Package: 'stx:libtool' }" |
|
14 |
||
15 |
"{ NameSpace: Tools }" |
|
16 |
||
17 |
TestCase subclass:#NavigationHistoryTests |
|
18 |
instanceVariableNames:'history' |
|
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
11776 | 21 |
category:'Interface-Browsers-New-History' |
10026 | 22 |
! |
23 |
||
24 |
!NavigationHistoryTests class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
18226 | 29 |
COPYRIGHT (c) 2015 Jan Vrany |
10026 | 30 |
All Rights Reserved |
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! ! |
|
40 |
||
41 |
!NavigationHistoryTests methodsFor:'initialization'! |
|
42 |
||
43 |
setUp |
|
44 |
||
45 |
history := NavigationHistory new |
|
46 |
||
47 |
"Created: / 21-02-2008 / 16:52:19 / janfrog" |
|
48 |
! ! |
|
49 |
||
50 |
!NavigationHistoryTests methodsFor:'tests'! |
|
51 |
||
52 |
test_01 |
|
53 |
||
54 |
self |
|
55 |
assert: history canGoBack not; |
|
56 |
assert: history canGoForward not |
|
57 |
||
58 |
"Created: / 21-02-2008 / 16:54:55 / janfrog" |
|
59 |
! |
|
60 |
||
61 |
test_02 |
|
62 |
||
63 |
history goTo: 1. |
|
64 |
||
65 |
self |
|
66 |
assert: history canGoBack not; |
|
67 |
assert: history canGoForward not |
|
68 |
||
69 |
"Created: / 21-02-2008 / 16:55:34 / janfrog" |
|
70 |
! |
|
71 |
||
72 |
test_03 |
|
73 |
history |
|
74 |
goTo:1; |
|
75 |
goTo:2; |
|
76 |
goTo:3; |
|
77 |
goBack. |
|
78 |
self |
|
79 |
assert:history currentItem = 2; |
|
80 |
assert:history canGoBack; |
|
81 |
assert:history goBackItems asArray = #( 1 ); |
|
82 |
assert:history canGoForward; |
|
83 |
assert:history goForwardItems asArray = #( 3 ). |
|
84 |
||
85 |
"Created: / 21-02-2008 / 16:57:29 / janfrog" |
|
86 |
"Modified: / 27-02-2008 / 11:52:26 / janfrog" |
|
87 |
"Modified: / 06-06-2008 / 09:31:24 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
88 |
! |
|
89 |
||
90 |
test_04 |
|
91 |
history |
|
92 |
goTo:1; |
|
93 |
goTo:2; |
|
94 |
goTo:3; |
|
95 |
goTo:2. |
|
96 |
self |
|
97 |
assert:history currentItem = 2; |
|
98 |
assert:history canGoBack; |
|
15844
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
99 |
assert:history goBackItems asArray = #( 3 2 1); |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
100 |
assert:history canGoForward not; |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
101 |
assert:history goForwardItems asArray = #( ). |
10026 | 102 |
|
103 |
"Created: / 21-02-2008 / 16:57:58 / janfrog" |
|
104 |
"Modified: / 27-02-2008 / 11:52:26 / janfrog" |
|
105 |
"Modified: / 06-06-2008 / 09:31:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
15844
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
106 |
"Modified: / 04-09-2015 / 06:56:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10026 | 107 |
! |
108 |
||
109 |
test_05 |
|
110 |
history |
|
111 |
goTo:1; |
|
112 |
goTo:2; |
|
113 |
goTo:3; |
|
114 |
goBack; |
|
115 |
goBack; |
|
116 |
goTo:5. |
|
117 |
self |
|
118 |
assert:history currentItem = 5; |
|
119 |
assert:history canGoBack; |
|
120 |
assert:history goBackItems asArray = #( 1 ); |
|
121 |
assert:history canGoForward not. |
|
122 |
||
123 |
"Created: / 21-02-2008 / 16:59:11 / janfrog" |
|
124 |
"Modified: / 27-02-2008 / 11:52:12 / janfrog" |
|
125 |
"Modified: / 06-06-2008 / 09:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
15844
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
126 |
! |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
127 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
128 |
test_06 |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
129 |
history goTo:1. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
130 |
self assert: history currentItem = 1. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
131 |
self assert: history canGoBack not. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
132 |
self assert: history goBackItems asArray = #( ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
133 |
self assert: history canGoForward not. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
134 |
self assert: history goForwardItems asArray = #( ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
135 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
136 |
history goTo:2. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
137 |
self assert: history currentItem = 2. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
138 |
self assert: history canGoBack . |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
139 |
self assert: history goBackItems asArray = #( 1 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
140 |
self assert: history canGoForward not. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
141 |
self assert: history goForwardItems asArray = #( ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
142 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
143 |
history goTo:3. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
144 |
self assert: history currentItem = 3. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
145 |
self assert: history canGoBack . |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
146 |
self assert: history goBackItems asArray = #( 2 1 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
147 |
self assert: history canGoForward not. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
148 |
self assert: history goForwardItems asArray = #( ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
149 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
150 |
history goTo:2. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
151 |
self assert: history currentItem = 2. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
152 |
self assert: history canGoBack . |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
153 |
self assert: history goBackItems asArray = #( 3 2 1 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
154 |
self assert: history canGoForward not. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
155 |
self assert: history goForwardItems asArray = #( ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
156 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
157 |
history goBack. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
158 |
self assert: history currentItem = 3. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
159 |
self assert: history canGoBack . |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
160 |
self assert: history goBackItems asArray = #( 2 1 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
161 |
self assert: history canGoForward. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
162 |
self assert: history goForwardItems asArray = #( 2 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
163 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
164 |
history goBack. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
165 |
self assert: history currentItem = 2. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
166 |
self assert: history canGoBack . |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
167 |
self assert: history goBackItems asArray = #( 1 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
168 |
self assert: history canGoForward. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
169 |
self assert: history goForwardItems asArray = #( 3 2 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
170 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
171 |
history goBack. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
172 |
self assert: history currentItem = 1. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
173 |
self assert: history canGoBack not. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
174 |
self assert: history goBackItems asArray = #( ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
175 |
self assert: history canGoForward. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
176 |
self assert: history goForwardItems asArray = #( 2 3 2 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
177 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
178 |
history goForward. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
179 |
self assert: history currentItem = 2. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
180 |
self assert: history canGoBack. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
181 |
self assert: history goBackItems asArray = #( 1 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
182 |
self assert: history canGoForward. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
183 |
self assert: history goForwardItems asArray = #( 3 2 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
184 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
185 |
history goForward. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
186 |
self assert: history currentItem = 3. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
187 |
self assert: history canGoBack. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
188 |
self assert: history goBackItems asArray = #( 2 1 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
189 |
self assert: history canGoForward. |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
190 |
self assert: history goForwardItems asArray = #( 2 ). |
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
191 |
|
024b2d99744a
More standard behaviour of navigation history
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12650
diff
changeset
|
192 |
"Created: / 04-09-2015 / 06:59:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10026 | 193 |
! ! |
194 |
||
195 |
!NavigationHistoryTests class methodsFor:'documentation'! |
|
196 |
||
197 |
version_CVS |
|
11776 | 198 |
^ '$Header: /cvs/stx/stx/libtool/Tools__NavigationHistoryTests.st,v 1.2 2012-09-02 11:21:14 cg Exp $' |
10026 | 199 |
! |
200 |
||
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
201 |
version_HG |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
202 |
|
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
203 |
^ '$Changeset: <not expanded> $' |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
204 |
! |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
205 |
|
10026 | 206 |
version_SVN |
207 |
^ '§Id: Tools__NavigationHistoryTests.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
208 |
! ! |
|
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
209 |