diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-02 12:19:26 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-02 12:19:26 +0000 |
commit | 396323726b55cd0ec7d7f3362b7091cd998f8708 (patch) | |
tree | 1380527eb78b6f389e6c051336a044ac28ba5b76 /test/unit/repository_mercurial_test.rb | |
parent | da071e5531d43f94b28b9043324e2688f3001b80 (diff) | |
download | redmine-396323726b55cd0ec7d7f3362b7091cd998f8708.tar.gz redmine-396323726b55cd0ec7d7f3362b7091cd998f8708.zip |
scm: mercurial: add test helper method to switch short or long id (#14361)
git-svn-id: http://svn.redmine.org/redmine/trunk@12771 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_mercurial_test.rb')
-rw-r--r-- | test/unit/repository_mercurial_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index d2efd848a..0ac7e1c9a 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -502,6 +502,18 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_nil changeset.next end end + + def test_scmid_for_assert + rev = "0123456789012345678901234567890123456789" + assert_equal rev, scmid_for_assert(rev, false) + assert_equal "012345678901", scmid_for_assert(rev, true) + end + + private + + def scmid_for_assert(hex, is_short=true) + is_short ? hex[0, 12] : hex + end else puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!" def test_fake; assert true end |