]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: test: add test of parents to unit lib test (#5501)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Oct 2011 04:57:43 +0000 (04:57 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Oct 2011 04:57:43 +0000 (04:57 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7667 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb

index cbd67c8fd95ed1eddefab34cbe4db0f5e8b7383f..95beb0d5467bcde768debe40ab5e6b2c55076f7a 100644 (file)
@@ -91,6 +91,21 @@ begin
         assert_equal '400bb8672109', revisions[0].scmid
       end
 
+      def test_parents
+        revs1 = @adapter.revisions(nil, 0, 0)
+        assert_equal 1, revs1.size
+        assert_equal [], revs1[0].parents
+        revs2 = @adapter.revisions(nil, 1, 1)
+        assert_equal 1, revs2.size
+        assert_equal 1, revs2[0].parents.size
+        assert_equal "0885933ad4f6", revs2[0].parents[0]
+        revs3 = @adapter.revisions(nil, 30, 30)
+        assert_equal 1, revs3.size
+        assert_equal 2, revs3[0].parents.size
+        assert_equal "a94b0528f24f", revs3[0].parents[0]
+        assert_equal "3a330eb32958", revs3[0].parents[1]
+      end
+
       def test_diff
         if @adapter.class.client_version_above?([1, 2])
           assert_nil @adapter.diff(nil, '100000')