mercurial/HGStXTests.st
changeset 474 f610e64874c8
parent 473 eeb6f7e3394d
child 509 f92210d4585b
--- a/mercurial/HGStXTests.st	Sun Nov 16 13:41:06 2014 +0000
+++ b/mercurial/HGStXTests.st	Sun Nov 16 23:52:21 2014 +0000
@@ -1879,6 +1879,30 @@
     self assert: (ChangeSet current includesChangeForClass: (Smalltalk at:#'MockHGP1Foo::Private1::Private2') selector: #meouw) not.
 
     "Created: / 16-11-2014 / 13:27:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_22a
+    "
+    Commit with empty message should throw a HGCommitError
+    "
+
+    | repo pm ct |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    self assert: (Smalltalk loadPackage:'mocks:hg/p1').
+    self dumpRepositoryLog: repo.
+
+
+    self deny:   ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1').
+
+    ((Smalltalk at:#MockHGP1Bar) compile:'zork ^ 1' classified:'test') package: (Smalltalk at:#MockHGP1Bar) package.
+    pm := HGPackageWorkingCopy named: 'mocks:hg/p1'.
+    ct := pm commitTask.
+    self assert: ct isCommitingNewHead not.
+    ct message:''.
+    self should:[ ct do ] raise: HGCommitError.
+
+    "Created: / 16-11-2014 / 23:48:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGStXTests methodsFor:'tests - commit - java'!