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 includes: 'comment') |
|
219 |
|
220 "Created: / 24-04-2014 / 11:28:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
175 ! ! |
221 ! ! |
176 |
222 |
177 !CodeGeneratorTests class methodsFor:'documentation'! |
223 !CodeGeneratorTests class methodsFor:'documentation'! |
178 |
224 |
179 version_CVS |
225 version_CVS |
180 ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTests.st,v 1.3 2014-02-05 18:56:09 cg Exp $' |
226 ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTests.st,v 1.4 2014-04-24 09:33:37 vrany Exp $' |
181 ! |
227 ! |
182 |
228 |
183 version_SVN |
229 version_SVN |
184 ^ '$Id: CodeGeneratorTests.st,v 1.3 2014-02-05 18:56:09 cg Exp $' |
230 ^ '$Id: CodeGeneratorTests.st,v 1.4 2014-04-24 09:33:37 vrany Exp $' |
185 ! ! |
231 ! ! |
186 |
232 |