diff options
author | Go MAEDA <maeda@farend.jp> | 2022-09-01 06:47:06 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-09-01 06:47:06 +0000 |
commit | 8cbe5014b18dd88c4224a9e579d11ed5e5f6a17b (patch) | |
tree | 90ace8c7dffcdf562cd40b49fcc2850af474f358 /test/unit/lib | |
parent | b9fb56e8999e717e5bdcdbd1594da575c1c41a7b (diff) | |
download | redmine-8cbe5014b18dd88c4224a9e579d11ed5e5f6a17b.tar.gz redmine-8cbe5014b18dd88c4224a9e579d11ed5e5f6a17b.zip |
Merged r21792 from trunk to 5.0-stable (#36258).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21794 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r-- | test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb index cd6a919e8..b329048d6 100644 --- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb @@ -87,8 +87,8 @@ class MercurialAdapterTest < ActiveSupport::TestCase adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo) repo_path = adp.info.root_url.tr('\\', "/") assert_equal REPOSITORY_PATH, repo_path - assert_equal '39', adp.info.lastrev.revision - assert_equal '04aed9840e9266e535f5f20f7e42c9f9f84f9cf4', adp.info.lastrev.scmid + assert_equal '42', adp.info.lastrev.revision + assert_equal 'ba20ebce08dbd2f0320b93faf7bba7c86186a1f7', adp.info.lastrev.scmid end end @@ -113,6 +113,14 @@ class MercurialAdapterTest < ActiveSupport::TestCase assert_equal "ctrl-s\u0013message", revisions[0].message end + def test_empty_message + revisions = @adapter.revisions(nil, '05b4c556a8a1', '05b4c556a8a1') + assert_equal 1, revisions.size + assert_equal '41', revisions[0].revision + assert_equal 'jsmith <jsmith@foo.bar>', revisions[0].author + assert_equal '', revisions[0].message + end + def test_parents revs1 = @adapter.revisions(nil, 0, 0) assert_equal 1, revs1.size @@ -349,7 +357,12 @@ class MercurialAdapterTest < ActiveSupport::TestCase @adapter.branches.each do |b| branches << b end - assert_equal 9, branches.length + assert_equal 10, branches.length + + branch = branches[-10] + assert_equal 'branch-empty-message', branch.to_s + assert_equal '42', branch.revision + assert_equal 'ba20ebce08dbd2f0320b93faf7bba7c86186a1f7', branch.scmid branch = branches[-9] assert_equal 'double"quote"branch', branch.to_s @@ -400,6 +413,7 @@ class MercurialAdapterTest < ActiveSupport::TestCase def test_branchmap bm = { + 'branch-empty-message' => 'ba20ebce08dbd2f0320b93faf7bba7c86186a1f7', 'double"quote"branch' => '04aed9840e9266e535f5f20f7e42c9f9f84f9cf4', 'issue-23055-ctrl-char' => '3e998343166a1b8273973bcd46dd2bad74344d74', 'default' => '31eeee7395c8c78e66dd54c50addd078d10b2355', |