Skip to content

Commit

Permalink
test: failing multibyte unicode test
Browse files Browse the repository at this point in the history
From #2410
  • Loading branch information
flavorjones committed Oct 16, 2022
1 parent 359e03d commit 46f60b5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/xml/test_c14n.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
# frozen_string_literal: true

require "helper"
Expand Down Expand Up @@ -237,6 +238,21 @@ def test_wrong_params
assert_raises(TypeError) { doc.canonicalize(nil, :wrong_type) }
doc.canonicalize(nil, nil, :wrong_type)
end

def test_multibyte_unicode
# https://github.com/sparklemotion/nokogiri/issues/2410
doc = Nokogiri.XML(%{<foo>𡏅</foo>}, nil, "EUC-JP")

# I do not understand what's going on here
expected = if Nokogiri.jruby?
%{<foo>𡏅</foo>}
else
%{<foo>陝</foo>}
end

result = doc.canonicalize
assert_equal(expected, result)
end
end
end
end

0 comments on commit 46f60b5

Please sign in to comment.