##// END OF EJS Templates
scm: add test of invalid utf8 sequences in committer at unit changeset test....
Toshi MARUYAMA -
r5350:5f8c4e070366
parent child
Show More
@@ -254,8 +254,10 class ChangesetTest < ActiveSupport::TestCase
254 254 def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1
255 255 proj = Project.find(3)
256 256 # str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
257 str = "Texte encod\xe9 en ISO-8859-1."
258 str.force_encoding("ASCII-8BIT") if str.respond_to?(:force_encoding)
257 str1 = "Texte encod\xe9 en ISO-8859-1."
258 str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e"
259 str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding)
260 str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding)
259 261 r = Repository::Bazaar.create!(
260 262 :project => proj,
261 263 :url => '/tmp/test/bazaar',
@@ -265,9 +267,11 class ChangesetTest < ActiveSupport::TestCase
265 267 :committed_on => Time.now,
266 268 :revision => '123',
267 269 :scmid => '12345',
268 :comments => str)
270 :comments => str1,
271 :committer => str2)
269 272 assert( c.save )
270 273 assert_equal "Texte encod? en ISO-8859-1.", c.comments
274 assert_equal "?a?b?c?d?e", c.committer
271 275 end
272 276
273 277 def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis
General Comments 0
You need to be logged in to leave comments. Login now