170 |
170 |
171 self assert: (self respondsTo: #mock_03b). |
171 self assert: (self respondsTo: #mock_03b). |
172 self assert: (self mock_03b = 30). |
172 self assert: (self mock_03b = 30). |
173 |
173 |
174 "Created: / 07-07-2009 / 19:54:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
174 "Created: / 07-07-2009 / 19:54:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
175 ! |
|
176 |
|
177 test_04a |
|
178 |
|
179 cg |
|
180 class: self class; |
|
181 source: '`@selector ^ 4'; |
|
182 replace: '`@selector' with: #mock_04a; |
|
183 compile. |
|
184 |
|
185 self assert: (self respondsTo: #mock_04a). |
|
186 self assert: (self mock_04a = 4). |
|
187 |
|
188 "Created: / 24-04-2014 / 11:13:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
189 ! |
|
190 |
|
191 test_04b |
|
192 |
|
193 cg |
|
194 class: self class; |
|
195 source: '`@selpart1 anArg `@selpart2 anArg2 ^ anArg + anArg2'; |
|
196 replace: '`@selpart1' with: #mock_04:; |
|
197 replace: '`@selpart2' with: #b:; |
|
198 compile. |
|
199 |
|
200 self assert: (self respondsTo: #mock_04:b:). |
|
201 self assert: ((self mock_04:123 b: 123) = (123+123)). |
|
202 |
|
203 "Created: / 24-04-2014 / 11:15:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
204 ! |
|
205 |
|
206 test_05 |
|
207 |
|
208 cg |
|
209 class: self class; |
|
210 source: 'mock_05 |
|
211 "comment" |
|
212 |
|
213 ^ 10'; |
|
214 compile. |
|
215 |
|
216 self assert: (self respondsTo: #mock_05). |
|
217 self assert: (self perform: #mock_05) == 10. |
|
218 self assert: ((self class >> #mock_05) source includesString: 'comment') |
|
219 |
|
220 "Created: / 24-04-2014 / 11:28:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
221 "Modified: / 24-05-2014 / 01:02:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
175 ! ! |
222 ! ! |
176 |
223 |
177 !CodeGeneratorTests class methodsFor:'documentation'! |
224 !CodeGeneratorTests class methodsFor:'documentation'! |
178 |
225 |
179 version_CVS |
226 version_CVS |
180 ^ '§Header: /cvs/stx/stx/libtool/CodeGeneratorTests.st,v 1.2 2011/07/03 13:41:39 cg Exp §' |
227 ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTests.st,v 1.5 2014-05-24 00:10:50 vrany Exp $' |
181 ! |
|
182 |
|
183 version_HG |
|
184 |
|
185 ^ '$Changeset: <not expanded> $' |
|
186 ! |
228 ! |
187 |
229 |
188 version_SVN |
230 version_SVN |
189 ^ '$Id: CodeGeneratorTests.st 7728 2011-05-05 23:02:13Z vranyj1 $' |
231 ^ '$Id: CodeGeneratorTests.st,v 1.5 2014-05-24 00:10:50 vrany Exp $' |
190 ! ! |
232 ! ! |
191 |
233 |