mercurial/HGStXTests.st
changeset 98 8982e002d0ab
parent 95 83ee62dc9491
child 100 7e2196730455
--- a/mercurial/HGStXTests.st	Fri Nov 23 10:21:39 2012 +0000
+++ b/mercurial/HGStXTests.st	Fri Nov 23 11:25:28 2012 +0000
@@ -366,6 +366,50 @@
     "Modified: / 22-11-2012 / 11:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!HGStXTests methodsFor:'tests - misc'!
+
+test_misc_fileReleaseAndRevisionNr
+    "
+    ProjectDefinition>>fileReleaseNr and ProjectDefinition>>fileRevisionNr
+    are used to generate package.rc used on Windows.
+
+    String returned must be an integer and must be a valid short value 
+    - otherwise, BCC won't compile/link the library.
+
+    If this test fail it means that implementation fileReleaseNr/fileRevisionNr
+    is rubbish. As of 2012-11-23, it uses 'self revision' and expects
+    (but does not check!!) the resulting string is in X.Y form. In mercurial,
+    #revision returns node id (SHA1 hash string).
+
+    It has to be fixed there!!
+    "
+
+    | repo |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    Smalltalk loadPackage:'mocks:hg/p1'.
+
+    self assert: (mocks_hg_p1 fileReleaseNr allSatisfy:[:c|c isDigit]).
+    self assert: (mocks_hg_p1 fileReleaseNr asInteger < 16r7FFF).
+
+    self assert: (mocks_hg_p1 fileRevisionNr allSatisfy:[:c|c isDigit]).
+    self assert: (mocks_hg_p1 fileRevisionNr asInteger < 16r7FFF).
+
+    "Created: / 23-11-2012 / 11:02:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_misc_hgRevision_01
+    | repo |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    Smalltalk loadPackage:'mocks:hg/p1'.
+    self dumpRepositoryLog: repo. 
+
+    self assert: mocks_hg_p1 hgLogicalRevision asString = '1:e0bec585af86b3ee98047baa69530b2b2484c9c0'.
+
+    "Created: / 23-11-2012 / 11:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !HGStXTests methodsFor:'utilities'!
 
 cleanup