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