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
parent 0e0a8c01ea
commit 0b19757303
1 changed files with 16 additions and 0 deletions

View File

@ -171,6 +171,14 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
@repository.reload @repository.reload
changesets = @repository.latest_changesets('README', nil) changesets = @repository.latest_changesets('README', nil)
assert_equal %w|8 6 1 0|, changesets.collect(&:revision) 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 end
def test_latest_changesets_with_dirpath def test_latest_changesets_with_dirpath
@ -178,6 +186,14 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
@repository.reload @repository.reload
changesets = @repository.latest_changesets('images', nil) changesets = @repository.latest_changesets('images', nil)
assert_equal %w|1 0|, changesets.collect(&:revision) 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 end
else else
puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!" puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"