scm: mercurial: unit app test for latest_changesets SQL "like" special character '%' and '_'.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4870 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-02-18 05:55:45 +00:00 committed by Eric Davis
parent c45f66c41e
commit 8f636b9b21
1 changed files with 16 additions and 0 deletions

View File

@ -171,6 +171,14 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
@repository.reload
changesets = @repository.latest_changesets('README', nil)
assert_equal %w|8 6 1 0|, changesets.collect(&:revision)
path = 'sql_escape/percent%dir/percent%file1.txt'
changesets = @repository.latest_changesets(path, nil)
assert_equal %w|11 10 9|, changesets.collect(&:revision)
path = 'sql_escape/underscore_dir/understrike_file.txt'
changesets = @repository.latest_changesets(path, nil)
assert_equal %w|12 9|, changesets.collect(&:revision)
end
def test_latest_changesets_with_dirpath
@ -178,6 +186,14 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
@repository.reload
changesets = @repository.latest_changesets('images', nil)
assert_equal %w|1 0|, changesets.collect(&:revision)
path = 'sql_escape/percent%dir'
changesets = @repository.latest_changesets(path, nil)
assert_equal %w|13 11 10 9|, changesets.collect(&:revision)
path = 'sql_escape/underscore_dir'
changesets = @repository.latest_changesets(path, nil)
assert_equal %w|13 12 9|, changesets.collect(&:revision)
end
else
puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"