862
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
|
3 |
"{ Package: 'exept:regression' }"
|
|
4 |
|
|
5 |
"{ NameSpace: RegressionTests }"
|
|
6 |
|
|
7 |
TestCase subclass:#ProjectDefinitionTests
|
|
8 |
instanceVariableNames:''
|
|
9 |
classVariableNames:''
|
|
10 |
poolDictionaries:''
|
|
11 |
category:'System-Support-Projects'
|
|
12 |
!
|
|
13 |
|
|
14 |
|
|
15 |
!ProjectDefinitionTests methodsFor:'running'!
|
|
16 |
|
|
17 |
tearDown
|
|
18 |
| classes methods |
|
|
19 |
|
|
20 |
"Also, wipe out all mocks"
|
|
21 |
classes := OrderedCollection new.
|
|
22 |
methods := OrderedCollection new.
|
|
23 |
Smalltalk allClassesDo:[:cls|
|
|
24 |
(cls package notNil and:[cls package startsWith:'exept:regression/testData']) ifTrue:[
|
|
25 |
classes add: cls
|
|
26 |
] ifFalse:[
|
|
27 |
cls methodsDo:[:m|(m package notNil and:[m package startsWith:'exept:regression/testData']) ifTrue:[methods add: m]].
|
|
28 |
cls class methodsDo:[:m|(m package notNil and:[m package startsWith:'exept:regression/testData']) ifTrue:[methods add: m]].
|
|
29 |
]
|
|
30 |
].
|
|
31 |
Class withoutUpdatingChangesDo:[
|
|
32 |
classes do:[:cls|Smalltalk removeClass: cls].
|
|
33 |
methods do:[:m|m mclass removeSelector: m selector]
|
|
34 |
].
|
|
35 |
|
|
36 |
"Created: / 22-03-2013 / 11:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
37 |
! !
|
|
38 |
|
|
39 |
!ProjectDefinitionTests methodsFor:'tests - utf8'!
|
|
40 |
|
|
41 |
test_filein_01
|
|
42 |
"
|
|
43 |
Test of filein of a class with non-ASCII/ISO8859-1 chars
|
|
44 |
"
|
|
45 |
| file |
|
|
46 |
|
|
47 |
file := (Smalltalk getPackageDirectoryForPackage: self class package) / 'testData' / 'packages' / 'p1utf8' / 'ProjectDefinitionTestsP1UTF8Bar.st'.
|
|
48 |
self assert: file exists.
|
|
49 |
|
|
50 |
file fileIn.
|
|
51 |
|
|
52 |
self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) notNil.
|
|
53 |
self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork size = 38.
|
|
54 |
self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
|
|
55 |
|
|
56 |
"Created: / 22-03-2013 / 11:39:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
57 |
!
|
|
58 |
|
|
59 |
test_filein_03
|
|
60 |
"
|
|
61 |
Test of filein of a extension with non-ASCII/ISO8859-1 chars
|
|
62 |
"
|
|
63 |
| file |
|
|
64 |
|
|
65 |
file := (Smalltalk getPackageDirectoryForPackage: self class package) / 'testData' / 'packages' / 'p1utf8' / 'extensions.st'.
|
|
66 |
self assert: file exists.
|
|
67 |
|
|
68 |
file fileIn.
|
|
69 |
|
|
70 |
self assert: nil zork size = 38.
|
|
71 |
self assert: nil zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
|
|
72 |
|
|
73 |
"Created: / 22-03-2013 / 11:40:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
74 |
!
|
|
75 |
|
|
76 |
test_loadPackage_utf8_01
|
|
77 |
"
|
|
78 |
Test of filein of a extension with non-ASCII/ISO8859-1 chars
|
|
79 |
"
|
|
80 |
|
|
81 |
Smalltalk loadPackage: 'exept:regression/testData/packages/p1utf8'.
|
|
82 |
|
|
83 |
self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) notNil.
|
|
84 |
self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork size = 38.
|
|
85 |
self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
|
|
86 |
|
|
87 |
self assert: nil zork size = 38.
|
|
88 |
self assert: nil zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
|
|
89 |
|
|
90 |
"Created: / 22-03-2013 / 11:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
91 |
! !
|
|
92 |
|
|
93 |
!ProjectDefinitionTests class methodsFor:'documentation'!
|
|
94 |
|
|
95 |
version
|
|
96 |
^ '$Header$'
|
|
97 |
!
|
|
98 |
|
|
99 |
version_CVS
|
|
100 |
^ '$Header$'
|
|
101 |
! !
|
|
102 |
|