author | Claus Gittinger <cg@exept.de> |
Tue, 08 May 2018 19:54:33 +0200 | |
changeset 1042 | 3b8c88c55251 |
parent 818 | 54a20a94c9be |
child 1121 | c5661215109c |
permissions | -rw-r--r-- |
23 | 1 |
"{ Package: 'stx:goodies/monticello/test' }" |
2 |
||
3 |
MCTestCase subclass:#MCVersionTest |
|
4 |
instanceVariableNames:'version' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
818
54a20a94c9be
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
7 |
category:'SCM-Monticello-Tests' |
23 | 8 |
! |
9 |
||
10 |
||
11 |
!MCVersionTest methodsFor:'asserting'! |
|
12 |
||
13 |
assert: aSelector orders: sexpr as: array |
|
14 |
| expected | |
|
15 |
expected := OrderedCollection new. |
|
16 |
version := self versionFromTree: sexpr. |
|
17 |
version perform: aSelector with: [:ea | expected add: ea info name]. |
|
18 |
self assert: expected asArray = array |
|
19 |
! |
|
20 |
||
21 |
assert: aSelector orders: sexpr as: expected unresolved: unresolved |
|
22 |
| missing visited | |
|
23 |
visited := OrderedCollection new. |
|
24 |
missing := OrderedCollection new. |
|
25 |
version := self versionFromTree: sexpr. |
|
26 |
version |
|
27 |
perform: aSelector |
|
28 |
with: [:ea | visited add: ea info name] |
|
29 |
with: [:ea | missing add: ea name]. |
|
30 |
self assert: visited asArray = expected. |
|
31 |
self assert: missing asArray = unresolved. |
|
32 |
! ! |
|
33 |
||
34 |
!MCVersionTest methodsFor:'building'! |
|
35 |
||
36 |
dependencyFromTree: sexpr |
|
37 |
^ MCMockDependency fromTree: sexpr |
|
38 |
! |
|
39 |
||
40 |
versionFromTree: sexpr |
|
41 |
^ (self dependencyFromTree: sexpr) resolve |
|
42 |
! ! |
|
43 |
||
44 |
!MCVersionTest methodsFor:'tests'! |
|
45 |
||
46 |
testAllAvailablePostOrder |
|
47 |
self |
|
48 |
assert: #allAvailableDependenciesDo: |
|
49 |
orders: #(a ((b (d e)) c)) |
|
50 |
as: #(d e b c) |
|
51 |
! |
|
52 |
||
53 |
testAllMissing |
|
54 |
self |
|
55 |
assert: #allDependenciesDo: |
|
56 |
orders: #(a ((b (d e)) (c missing))) |
|
57 |
as: #(d e b) |
|
58 |
! |
|
59 |
||
60 |
testAllUnresolved |
|
61 |
self |
|
62 |
assert: #allDependenciesDo:ifUnresolved: |
|
63 |
orders: #(a ((b (d e)) (c missing))) |
|
64 |
as: #(d e b) |
|
65 |
unresolved: #(c) |
|
66 |
! |
|
67 |
||
68 |
testDependencyOrder |
|
69 |
self |
|
70 |
assert: #allDependenciesDo: |
|
71 |
orders: #(a (b c)) |
|
72 |
as: #(b c) |
|
73 |
! |
|
74 |
||
75 |
testPostOrder |
|
76 |
self |
|
77 |
assert: #allDependenciesDo: |
|
78 |
orders: #(a ((b (d e)) c)) |
|
79 |
as: #(d e b c) |
|
80 |
! |
|
81 |
||
82 |
testWithAll |
|
83 |
self |
|
84 |
assert: #withAllDependenciesDo: |
|
85 |
orders: #(a ((b (d e)) c)) |
|
86 |
as: #(d e b c a) |
|
87 |
! |
|
88 |
||
89 |
testWithAllMissing |
|
90 |
self |
|
91 |
assert: #withAllDependenciesDo: |
|
92 |
orders: #(a ((b (d e)) (c missing))) |
|
93 |
as: #(d e b a) |
|
94 |
! |
|
95 |
||
96 |
testWithAllUnresolved |
|
97 |
self |
|
98 |
assert: #withAllDependenciesDo:ifUnresolved: |
|
99 |
orders: #(a ((b (d e)) (c missing))) |
|
100 |
as: #(d e b a) |
|
101 |
unresolved: #(c) |
|
102 |
! ! |
|
103 |
||
104 |
!MCVersionTest class methodsFor:'documentation'! |
|
105 |
||
106 |
version |
|
818
54a20a94c9be
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
107 |
^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCVersionTest.st,v 1.2 2013-05-29 00:01:51 vrany Exp $' |
23 | 108 |
! ! |
818
54a20a94c9be
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
109 |