scm: git: add tests for path encoding cat, diff and blame in unit adapter test (#5251).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5044 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
be67b2ec41
commit
2ff3b15854
|
@ -12,10 +12,22 @@ begin
|
||||||
|
|
||||||
FELIX_UTF8 = "Felix Schäfer"
|
FELIX_UTF8 = "Felix Schäfer"
|
||||||
FELIX_HEX = "Felix Sch\xC3\xA4fer"
|
FELIX_HEX = "Felix Sch\xC3\xA4fer"
|
||||||
|
CHAR_1_HEX = "\xc3\x9c"
|
||||||
|
|
||||||
if File.directory?(REPOSITORY_PATH)
|
if File.directory?(REPOSITORY_PATH)
|
||||||
def setup
|
def setup
|
||||||
@adapter = Redmine::Scm::Adapters::GitAdapter.new(REPOSITORY_PATH)
|
@adapter = Redmine::Scm::Adapters::GitAdapter.new(
|
||||||
|
REPOSITORY_PATH,
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
'ISO-8859-1'
|
||||||
|
)
|
||||||
|
assert @adapter
|
||||||
|
@char_1 = CHAR_1_HEX.dup
|
||||||
|
if @char_1.respond_to?(:force_encoding)
|
||||||
|
@char_1.force_encoding('UTF-8')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_scm_version
|
def test_scm_version
|
||||||
|
@ -104,6 +116,22 @@ begin
|
||||||
assert_equal "2010-09-18 19:59:46".to_time, last_rev.time
|
assert_equal "2010-09-18 19:59:46".to_time, last_rev.time
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_latin_1_path
|
||||||
|
if Redmine::Platform.mswin?
|
||||||
|
# TODO
|
||||||
|
else
|
||||||
|
p2 = "latin-1-dir/test-#{@char_1}-2.txt"
|
||||||
|
['4fc55c43bf3d3dc2efb66145365ddc17639ce81e', '4fc55c43bf3'].each do |r1|
|
||||||
|
assert @adapter.diff(p2, r1)
|
||||||
|
assert @adapter.cat(p2, r1)
|
||||||
|
assert_equal 1, @adapter.annotate(p2, r1).lines.length
|
||||||
|
['64f1f3e89ad1cb57976ff0ad99a107012ba3481d', '64f1f3e89ad1cb5797'].each do |r2|
|
||||||
|
assert @adapter.diff(p2, r1, r2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def test_scm_version_for(scm_command_version, version)
|
def test_scm_version_for(scm_command_version, version)
|
||||||
|
|
Loading…
Reference in New Issue