author | Patrik Svestka <patrik.svestka@gmail.com> |
Tue, 09 Apr 2019 11:18:28 +0200 | |
branch | jv |
changeset 2214 | ba58ef8a6214 |
parent 2073 | eaf032c8d02f |
permissions | -rwxr-xr-x |
2073
eaf032c8d02f
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1447
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
eaf032c8d02f
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1447
diff
changeset
|
2 |
|
579 | 3 |
" |
4 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
1447 | 5 |
All Rights Reserved |
579 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
1447 | 14 |
"{ Package: 'stx:goodies/regression' }" |
579 | 15 |
|
16 |
"{ NameSpace: RegressionTests }" |
|
17 |
||
18 |
TestCase subclass:#SelectorNamespacesTests |
|
19 |
instanceVariableNames:'ambiguousMessageSelector' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
683 | 22 |
category:'tests-Regression' |
579 | 23 |
! |
24 |
||
25 |
!SelectorNamespacesTests class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
1447 | 30 |
All Rights Reserved |
579 | 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 |
!SelectorNamespacesTests methodsFor:'error handling'! |
|
42 |
||
43 |
ambiguousMessage: aMessage |
|
44 |
||
45 |
ambiguousMessageSelector := aMessage selector |
|
46 |
||
47 |
"Created: / 19-08-2010 / 22:29:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
48 |
! ! |
|
49 |
||
50 |
!SelectorNamespacesTests methodsFor:'initialization & release'! |
|
51 |
||
52 |
setUp |
|
53 |
||
54 |
(NameSpace name: #TestNS3) import: (NameSpace name: #TestNS2). |
|
55 |
||
56 |
(NameSpace name: #TestNS4) import: (NameSpace name: #TestNS1). |
|
57 |
(NameSpace name: #TestNS4) import: (NameSpace name: #TestNS2). |
|
58 |
||
59 |
ObjectMemory flushCaches |
|
60 |
||
61 |
"Modified: / 21-07-2010 / 17:12:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
62 |
! |
|
63 |
||
64 |
tearDown |
|
65 |
||
66 |
(NameSpace name: #TestNS1) setImports: nil. |
|
67 |
(NameSpace name: #TestNS2) setImports: nil. |
|
68 |
(NameSpace name: #TestNS3) setImports: nil. |
|
69 |
(NameSpace name: #TestNS4) setImports: nil. |
|
70 |
||
71 |
"Created: / 21-07-2010 / 16:02:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
72 |
! ! |
|
73 |
||
74 |
!SelectorNamespacesTests methodsFor:'methods'! |
|
75 |
||
76 |
bar |
|
77 |
||
78 |
<namespace: #TestNS1 > |
|
79 |
||
80 |
^self foo |
|
81 |
||
82 |
"Created: / 21-07-2010 / 15:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
83 |
! |
|
84 |
||
85 |
foo |
|
86 |
<namespace: #TestNS1 > |
|
87 |
||
88 |
^#foo_NS1 |
|
89 |
||
90 |
"Created: / 01-07-2010 / 18:09:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
91 |
"Modified: / 21-07-2010 / 15:45:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
92 |
! |
|
93 |
||
94 |
foo |
|
95 |
<namespace: #TestNS2 > |
|
96 |
||
97 |
^#foo_NS2 |
|
98 |
||
99 |
"Created: / 21-07-2010 / 15:47:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
100 |
! |
|
101 |
||
102 |
baz |
|
103 |
||
104 |
<namespace: TestNS3> |
|
105 |
||
106 |
^self foo |
|
107 |
||
108 |
"Created: / 21-07-2010 / 16:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
109 |
! |
|
110 |
||
111 |
qux |
|
112 |
||
113 |
<namespace: TestNS4> |
|
114 |
||
115 |
^self foo |
|
116 |
||
117 |
"Created: / 21-07-2010 / 16:02:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
! |
|
119 |
||
120 |
foo |
|
121 |
||
122 |
^#foo |
|
123 |
||
124 |
"Created: / 01-07-2010 / 18:09:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
125 |
"Modified: / 01-07-2010 / 20:46:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
126 |
! ! |
|
127 |
||
128 |
!SelectorNamespacesTests methodsFor:'tests'! |
|
129 |
||
130 |
test_01 |
|
131 |
||
132 |
self assert: self foo == #foo. |
|
133 |
self assert: self bar == #foo_NS1 |
|
134 |
||
135 |
"Created: / 01-07-2010 / 18:47:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
136 |
"Modified: / 21-07-2010 / 15:59:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
137 |
! |
|
138 |
||
139 |
test_02 |
|
140 |
||
141 |
"Basic imports" |
|
142 |
||
1447 | 143 |
self assert: |
144 |
((NameSpace name: #TestNS3) imports includes: (NameSpace name: #TestNS2)). |
|
579 | 145 |
self assert: self baz == #foo_NS2. |
146 |
||
147 |
"Created: / 21-07-2010 / 16:05:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
148 |
"Modified: / 21-07-2010 / 17:19:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
149 |
! |
|
150 |
||
151 |
test_03 |
|
152 |
||
153 |
"Ambiguous send" |
|
1447 | 154 |
"Disable, I need a kind of unwind-protect on a C level. |
579 | 155 |
Is that possible?" |
1447 | 156 |
|
579 | 157 |
self shouldnt:[self qux] raise: AmbiguousMessage. |
158 |
self assert: ambiguousMessageSelector == #foo. |
|
159 |
||
160 |
"Created: / 19-08-2010 / 22:28:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
161 |
! ! |
|
162 |
||
163 |
!SelectorNamespacesTests class methodsFor:'documentation'! |
|
164 |
||
165 |
version_CVS |
|
166 |
^ '$Header$' |
|
167 |
! |
|
168 |
||
169 |
version_SVN |
|
2073
eaf032c8d02f
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1447
diff
changeset
|
170 |
^ '§ Id: SelectorNamespacesTests.st 10567 2010-08-19 20:39:34Z vranyj1 §' |
579 | 171 |
! ! |