Added tests for issue #8.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 22 Mar 2013 11:21:20 +0000
changeset 277 e0757a483c1e
parent 276 8fcaf8f2e51b
child 278 4bacce9509fe
Added tests for issue #8.
mercurial/HGStXTests.st
--- a/mercurial/HGStXTests.st	Fri Mar 22 09:09:49 2013 +0000
+++ b/mercurial/HGStXTests.st	Fri Mar 22 11:21:20 2013 +0000
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2012-2013 by Jan Vrany
               All Rights Reserved
@@ -912,6 +914,99 @@
 
     "Created: / 18-03-2013 / 19:01:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 18-03-2013 / 23:05:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_12a
+    "
+        Test correct fileout or class with respect to UTF8.  
+        This checks for issue #8.
+
+    "
+
+    | repo pm ct contents |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    self assert: (Smalltalk loadPackage: 'mocks:hg/p1').
+
+    (Smalltalk at: #MockHGP1Bar) compile:'zork
+
+    ^''Příliš žluťoučký kůň úpěl ďábelské ódy''' classified: 'utf8 methods'.
+
+    pm := HGPackageModel named: #'mocks:hg/p1'.
+    ct := pm commitTask.
+    ct message:'test_commit_12a'.
+    ct do.
+
+    "
+        repo workingCopy browse
+    "
+    contents := (repo @ 2 / 'MockHGP1Bar.st') contents.
+    self assert: (contents  asString includesString:'"{ Encoding: utf8 }"').
+    self assert: (contents  asString includesString:'Příliš žluťoučký kůň úpěl ďábelské ódy') not.
+
+    contents := (repo @ 1 / 'MockHGP1Bar.st') contents.
+    self assert: (contents  asString includesString:'"{ Encoding: utf8 }"') not.
+
+    "Created: / 22-03-2013 / 09:44:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_12b
+    "
+        Test correct fileout of extensions with respect to UTF8. 
+        This checks for issue #8.
+    "
+
+    | repo pm ct contents |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    self assert: (Smalltalk loadPackage: 'mocks:hg/p1').
+
+    ((UndefinedObject) compile:'zork
+    ^''Příliš žluťoučký kůň úpěl ďábelské ódy''' classified: 'utf8 methods')
+    package: #'mocks:hg/p1'.
+
+    pm := HGPackageModel named: #'mocks:hg/p1'.
+    ct := pm commitTask.
+    ct message:'test_commit_12b'.
+    ct do.
+
+    "
+        repo workingCopy browse
+    "
+    contents := (repo @ 2 / 'extensions.st') contents.
+    self assert: (contents  asString includesString:'"{ Encoding: utf8 }"').
+    self assert: (contents  asString includesString:'Příliš žluťoučký kůň úpěl ďábelské ódy') not.
+
+    "Created: / 22-03-2013 / 09:46:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_12c
+    "
+        Test correct fileout of extensions with respect to UTF8.
+        This checks for issue #8.
+    "
+
+    | repo pm ct contents |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    self assert: (Smalltalk loadPackage: 'mocks:hg/p1').
+
+    ((UndefinedObject) compile:'zork
+    ^''XUZ''' classified: 'utf8 methods')
+    package: #'mocks:hg/p1'.
+
+    pm := HGPackageModel named: #'mocks:hg/p1'.
+    ct := pm commitTask.
+    ct message:'test_commit_12b'.
+    ct do.
+
+    "
+        repo workingCopy browse
+    "
+    contents := (repo @ 2 / 'extensions.st') contents.
+    self assert: (contents  asString includesString:'"{ Encoding: utf8 }"') not.
+
+    "Created: / 22-03-2013 / 10:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGStXTests methodsFor:'tests - manager API'!