RegressionTests__ProjectDefinitionTests.st
changeset 862 7058c26053ea
child 865 dc2ba8aef5f5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RegressionTests__ProjectDefinitionTests.st	Fri Mar 22 12:50:42 2013 +0100
@@ -0,0 +1,102 @@
+"{ Encoding: utf8 }"
+
+"{ Package: 'exept:regression' }"
+
+"{ NameSpace: RegressionTests }"
+
+TestCase subclass:#ProjectDefinitionTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'System-Support-Projects'
+!
+
+
+!ProjectDefinitionTests methodsFor:'running'!
+
+tearDown
+    | classes methods |
+
+    "Also, wipe out all mocks"
+    classes := OrderedCollection new.
+    methods := OrderedCollection new.
+    Smalltalk allClassesDo:[:cls|
+        (cls package notNil and:[cls package startsWith:'exept:regression/testData']) ifTrue:[
+            classes add: cls
+        ] ifFalse:[
+            cls methodsDo:[:m|(m package notNil and:[m package startsWith:'exept:regression/testData']) ifTrue:[methods add: m]].
+            cls class methodsDo:[:m|(m package notNil and:[m package startsWith:'exept:regression/testData']) ifTrue:[methods add: m]].
+        ]
+    ].
+    Class withoutUpdatingChangesDo:[
+        classes do:[:cls|Smalltalk removeClass: cls].
+        methods do:[:m|m mclass removeSelector: m selector]
+    ].
+
+    "Created: / 22-03-2013 / 11:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ProjectDefinitionTests methodsFor:'tests - utf8'!
+
+test_filein_01
+    "
+    Test of filein of a class with non-ASCII/ISO8859-1 chars
+    "
+    | file |
+
+    file := (Smalltalk getPackageDirectoryForPackage: self class package) / 'testData' / 'packages' / 'p1utf8' / 'ProjectDefinitionTestsP1UTF8Bar.st'.
+    self assert: file exists.
+
+    file fileIn.
+
+    self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) notNil.
+    self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork size = 38.
+    self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
+
+    "Created: / 22-03-2013 / 11:39:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_filein_03
+    "
+    Test of filein of a extension with non-ASCII/ISO8859-1 chars
+    "
+    | file |
+
+    file := (Smalltalk getPackageDirectoryForPackage: self class package) / 'testData' / 'packages' / 'p1utf8' / 'extensions.st'.
+    self assert: file exists.
+
+    file fileIn.
+
+    self assert: nil zork size = 38.
+    self assert: nil zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
+
+    "Created: / 22-03-2013 / 11:40:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_loadPackage_utf8_01
+    "
+    Test of filein of a extension with non-ASCII/ISO8859-1 chars
+    "
+
+    Smalltalk loadPackage: 'exept:regression/testData/packages/p1utf8'.
+
+    self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) notNil.
+    self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork size = 38.
+    self assert: (Smalltalk at:#ProjectDefinitionTestsP1UTF8Bar) new zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
+
+    self assert: nil zork size = 38.
+    self assert: nil zork = 'Příliš žluťoučký kůň úpěl ďábelské ódy'.
+
+    "Created: / 22-03-2013 / 11:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ProjectDefinitionTests class methodsFor:'documentation'!
+
+version
+    ^ '$Header$'
+!
+
+version_CVS
+    ^ '$Header$'
+! !
+