@@ -322,6 +322,35 class ChangesetTest < ActiveSupport::TestCase | |||
|
322 | 322 | assert_equal s4, c.comments |
|
323 | 323 | end |
|
324 | 324 | |
|
325 | def test_invalid_utf8_sequences_in_paths_should_be_replaced | |
|
326 | proj = Project.find(3) | |
|
327 | str1 = "Texte encod\xe9 en ISO-8859-1" | |
|
328 | str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e" | |
|
329 | str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding) | |
|
330 | str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding) | |
|
331 | r = Repository::Bazaar.create!( | |
|
332 | :project => proj, | |
|
333 | :url => '/tmp/test/bazaar', | |
|
334 | :log_encoding => 'UTF-8' ) | |
|
335 | assert r | |
|
336 | cs = Changeset.new( | |
|
337 | :repository => r, | |
|
338 | :committed_on => Time.now, | |
|
339 | :revision => '123', | |
|
340 | :scmid => '12345', | |
|
341 | :comments => "test") | |
|
342 | assert( cs.save ) | |
|
343 | ch = Change.new( | |
|
344 | :changeset => cs, | |
|
345 | :action => "A", | |
|
346 | :path => str1, | |
|
347 | :from_path => str2, | |
|
348 | :from_revision => "345") | |
|
349 | assert( ch.save ) | |
|
350 | assert_equal "Texte encod? en ISO-8859-1", ch.path | |
|
351 | assert_equal "?a?b?c?d?e", ch.from_path | |
|
352 | end | |
|
353 | ||
|
325 | 354 | def test_comments_nil |
|
326 | 355 | proj = Project.find(3) |
|
327 | 356 | r = Repository::Bazaar.create!( |
General Comments 0
You need to be logged in to leave comments.
Login now