summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/stringio/stringio.c6
-rw-r--r--test/stringio/test_stringio.rb10
2 files changed, 16 insertions, 0 deletions
@@ -1464,8 +1464,14 @@ strio_write(VALUE self, VALUE str)
}
}
else {
strio_extend(ptr, ptr->pos, len);
memmove(RSTRING_PTR(ptr->string)+ptr->pos, RSTRING_PTR(str), len);
}
RB_GC_GUARD(str);
ptr->pos += len;
@@ -953,6 +953,16 @@ class TestStringIO < Test::Unit::TestCase
$VERBOSE = verbose
end
def assert_string(content, encoding, str, mesg = nil)
assert_equal([content, encoding], [str, str.encoding], mesg)
end