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
This commit is contained in:
Toshi MARUYAMA 2014-02-02 12:19:26 +00:00
parent da071e5531
commit 396323726b
1 changed files with 12 additions and 0 deletions

View File

@ -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