784
|
1 |
"{ Package: 'exept:regression' }"
|
|
2 |
|
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
|
5 |
TestCase subclass:#CompilerTests2
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'System-Compiler'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!CompilerTests2 methodsFor:'setup'!
|
|
14 |
|
|
15 |
tearDown
|
|
16 |
|
|
17 |
(Smalltalk at: #'exept_regression_testData_CompilerTests2') notNil ifTrue:[
|
|
18 |
(Smalltalk at: #'exept_regression_testData_CompilerTests2') classes do:[:e|
|
|
19 |
e notNil ifTrue:[
|
|
20 |
Smalltalk removeClass: e
|
|
21 |
].
|
|
22 |
]
|
|
23 |
].
|
|
24 |
|
|
25 |
"Created: / 26-10-2012 / 11:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
26 |
"Modified: / 12-02-2013 / 16:12:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
27 |
! !
|
|
28 |
|
|
29 |
!CompilerTests2 methodsFor:'tests'!
|
|
30 |
|
|
31 |
test_01
|
|
32 |
"JV@2012-10-26:
|
|
33 |
|
|
34 |
When a package is loaded from source using
|
|
35 |
|
|
36 |
Smalltalk loadPackage:'...'
|
|
37 |
|
|
38 |
expression __EVALUATED FROM WORKSPACE__ AND a method from loaded class
|
|
39 |
uses a class from the same package that is not yet loaded (i.e., it will
|
|
40 |
be loaded later),
|
|
41 |
|
|
42 |
then the compiler as of 2012-10-26 generates access to a workspace variable
|
|
43 |
instead of access to a global
|
|
44 |
|
|
45 |
This tests checks for this bug
|
|
46 |
"
|
|
47 |
|
|
48 |
| ws |
|
|
49 |
|
|
50 |
"/First, make sure that package is not yet loaded...
|
|
51 |
self
|
|
52 |
assert: (Smalltalk at: #'exept_regression_testData_CompilerTests2') isNil
|
|
53 |
description: 'Mock package already loaded'.
|
|
54 |
|
|
55 |
ws := WorkspaceApplication new.
|
|
56 |
ws selectedWorkspace contents: '(Smalltalk loadPackage: #''exept:regression/testData/CompilerTests2'')'.
|
|
57 |
ws selectedWorkspace selectAll.
|
|
58 |
ws selectedWorkspace doIt.
|
|
59 |
|
|
60 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class
|
|
61 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2')
|
|
62 |
|
|
63 |
"Created: / 26-10-2012 / 11:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
64 |
"Modified (comment): / 12-02-2013 / 16:24:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
65 |
!
|
|
66 |
|
|
67 |
test_02
|
|
68 |
"JV@2012-10-26:
|
|
69 |
|
|
70 |
When a package is loaded from source using
|
|
71 |
|
|
72 |
Smalltalk loadPackage:'...'
|
|
73 |
|
|
74 |
expression and a method from loaded class in namespace uses a class from the
|
|
75 |
same package and same namespace, that is not yet loaded (i.e., it will be loaded
|
|
76 |
later),
|
|
77 |
|
|
78 |
then the compiler as of 2012-10-26 generates access to class in no namespace.
|
|
79 |
|
|
80 |
This test checks for this bug
|
|
81 |
"
|
|
82 |
|
|
83 |
"/First, make sure that package is not yet loaded...
|
|
84 |
self
|
|
85 |
assert: (Smalltalk at: #'exept_regression_estData_CompilerTests2') isNil
|
|
86 |
description: 'Mock package already loaded'.
|
|
87 |
|
|
88 |
self
|
|
89 |
assert: (Smalltalk loadPackage: #'exept:regression/testData/CompilerTests2')
|
|
90 |
description: 'Cannot load mock package!!'.
|
|
91 |
|
|
92 |
|
|
93 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class
|
|
94 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2')
|
|
95 |
|
|
96 |
"Created: / 26-10-2012 / 12:26:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
97 |
"Modified (comment): / 12-02-2013 / 16:24:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
98 |
! !
|
|
99 |
|
|
100 |
!CompilerTests2 class methodsFor:'documentation'!
|
|
101 |
|
|
102 |
version
|
|
103 |
^ '$Header$'
|
|
104 |
!
|
|
105 |
|
|
106 |
version_CVS
|
|
107 |
^ '$Header$'
|
|
108 |
!
|
|
109 |
|
|
110 |
version_SVN
|
|
111 |
^ '§Id:: RegressionTests__CompilerTests2.st 506 2012-10-26 12:03:11Z vranyj1 §'
|
|
112 |
! !
|
|
113 |
|