mercurial/HGTests.st
changeset 105 25e8ff9d2a31
parent 103 04731ef44417
child 106 99be3b5a40da
equal deleted inserted replaced
104:2e22c33bfafa 105:25e8ff9d2a31
    54 
    54 
    55     "Created: / 19-09-2012 / 23:06:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    55     "Created: / 19-09-2012 / 23:06:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    56     "Modified: / 22-11-2012 / 11:42:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    56     "Modified: / 22-11-2012 / 11:42:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    57 ! !
    57 ! !
    58 
    58 
       
    59 !HGTests methodsFor:'tests - branches'!
       
    60 
       
    61 test_branches_01
       
    62     "
       
    63     Test listing branches
       
    64     "
       
    65 
       
    66     | repo branches |
       
    67 
       
    68     repo := self repositoryNamed:'test_repo_02'.
       
    69     branches := repo branches.
       
    70 
       
    71     self assert: branches first name = 'default'.
       
    72     self assert: branches first isActive.
       
    73     self assert: branches first isClosed not.
       
    74 
       
    75     self assert: branches second name = 'branch1'.
       
    76     self assert: branches second isActive not.
       
    77     self assert: branches second isClosed not.
       
    78 
       
    79     self assert: branches third name = 'branch2'.
       
    80     self assert: branches third isActive.
       
    81     self assert: branches third isClosed.
       
    82 
       
    83     "Created: / 27-11-2012 / 19:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    84 !
       
    85 
       
    86 test_branches_02
       
    87     "
       
    88     Test getting current branch (branch of currently checked-out working copy)
       
    89     "
       
    90 
       
    91     | repo wc branch |
       
    92 
       
    93     repo := self repositoryNamed:'test_repo_02'.
       
    94     wc := repo workingCopy.
       
    95     branch := wc branch.
       
    96 
       
    97     self assert: branch name = 'default'.
       
    98     self assert: wc changeset branch == branch.
       
    99 
       
   100     "Created: / 27-11-2012 / 20:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   101 ! !
       
   102 
    59 !HGTests methodsFor:'tests - changesets'!
   103 !HGTests methodsFor:'tests - changesets'!
    60 
   104 
    61 test_changeset_01
   105 test_changeset_01
    62     "
   106     "
    63     Test accessing changesets
   107     Test accessing changesets
   166     self assert: (repo @ 1 / 'f1.txt') contents asString = 'f1-C0
   210     self assert: (repo @ 1 / 'f1.txt') contents asString = 'f1-C0
   167 f1-C1
   211 f1-C1
   168 '
   212 '
   169 
   213 
   170     "Created: / 17-11-2012 / 00:19:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   214     "Created: / 17-11-2012 / 00:19:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   215 !
       
   216 
       
   217 test_changeset_06
       
   218     "
       
   219     Test access to changeset contents
       
   220     "
       
   221 
       
   222     | repo cs |
       
   223 
       
   224     repo := self repositoryNamed:'test_repo_02'.
       
   225     cs := repo @ 5.
       
   226     self assert: cs parent1 id revno = 0.
       
   227     self assert: cs parent2 id revno = 4.
       
   228 
       
   229     "Created: / 27-11-2012 / 20:54:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   171 ! !
   230 ! !
   172 
   231 
   173 !HGTests methodsFor:'tests - node id'!
   232 !HGTests methodsFor:'tests - node id'!
   174 
   233 
   175 test_nodeid_01
   234 test_nodeid_01