author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 02 Sep 2015 09:18:30 +0100 | |
changeset 4 | 90637b709fa9 |
parent 2 | e439b82dda7d |
permissions | -rw-r--r-- |
0 | 1 |
"{ Package: 'stx:goodies/ring/tests' }" |
2 |
||
3 |
"{ NameSpace: Smalltalk }" |
|
4 |
||
5 |
TestCase subclass:#RGPackageTest |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'Ring-Core-Containers-Tests' |
|
10 |
! |
|
11 |
||
12 |
RGPackageTest comment:'SUnit tests for packages' |
|
13 |
! |
|
14 |
||
2
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
15 |
|
0 | 16 |
!RGPackageTest methodsFor:'testing'! |
17 |
||
18 |
testAddingClass |
|
19 |
| newPackage newClass | |
|
20 |
||
21 |
newPackage:= RGPackage named: #'Collections-Sequenceable'. |
|
22 |
newClass:= RGClassDefinition named: #OrderedCollection. |
|
23 |
newPackage addClass: newClass. |
|
24 |
||
25 |
self assert: (newPackage hasClasses). |
|
26 |
self assert: (newClass package == newPackage). |
|
27 |
self assert: ((newPackage classNamed: #OrderedCollection) == newClass) |
|
28 |
! |
|
29 |
||
30 |
testAddingPackage |
|
31 |
| newPackage childPackage | |
|
32 |
||
33 |
newPackage:= RGPackage named: #'Collections'. |
|
34 |
newPackage addPackageNamed: #'Collections-Sequenceable'. |
|
35 |
||
36 |
self assert: (newPackage includesPackageNamed: #'Collections-Sequenceable'). |
|
37 |
self assert: (newPackage packages size = 1). |
|
38 |
||
39 |
childPackage:= newPackage packageNamed: #'Collections-Sequenceable'. |
|
40 |
self assert: (childPackage parent = newPackage parent). |
|
41 |
self assert: (childPackage package = newPackage). |
|
42 |
! |
|
43 |
||
44 |
testNewPackage |
|
45 |
| newPackage | |
|
46 |
||
47 |
newPackage:= RGPackage named: 'Collections-Sequenceable'. |
|
48 |
||
49 |
self assert: (newPackage isPackage). |
|
50 |
self assert: (newPackage name = 'Collections-Sequenceable'). |
|
51 |
self assert: (newPackage classes isEmpty). |
|
52 |
self assert: (newPackage traits isEmpty). |
|
53 |
self assert: (newPackage packages isEmpty). |
|
54 |
self assert: (newPackage package isNil). |
|
55 |
self assert: (newPackage parent == Smalltalk globals). |
|
56 |
! ! |
|
57 |
||
2
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
58 |
!RGPackageTest class methodsFor:'documentation'! |
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
59 |
|
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
60 |
version_HG |
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
61 |
|
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
62 |
^ '$Changeset: <not expanded> $' |
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
63 |
! ! |
e439b82dda7d
Fixed some tests. Not all pass, though,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
64 |