We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
rb_econv_append
1 parent 485019c commit b32a3f1Copy full SHA for b32a3f1
test/-ext-/econv/test_append.rb
@@ -0,0 +1,23 @@
1
+# frozen_string_literal: false
2
+require 'test/unit'
3
+require "-test-/econv"
4
+
5
+class Test_EConvAppend < Test::Unit::TestCase
6
+ def test_econv_str_append_valid
7
+ ec = Bug::EConv.new("utf-8", "cp932")
8
+ dst = "\u3044".encode("cp932")
9
+ ret = ec.append("\u3042"*30, dst)
10
+ assert_same(dst, ret)
11
+ assert_not_predicate(dst, :ascii_only?)
12
+ assert_predicate(dst, :valid_encoding?)
13
+ end
14
15
+ def test_econv_str_append_broken
16
17
+ dst = ""
18
19
20
21
+ assert_not_predicate(dst, :valid_encoding?)
22
23
+end
0 commit comments