ksss / mruby-stringio

StringIO class for mruby
MIT License
10 stars 6 forks source link

StringIO#puts does not print a newline character when not given any arguments #6

Closed ntl closed 4 years ago

ntl commented 4 years ago

It looks like StringIO#puts prints a newline after every string argument given, but it does not handle the case where #puts is called without any arguments. MRI prints a newline in this case.

string_io = StringIO.new
string_io.puts
# Will not pass currently
assert(string_io.string == "\n")

For the time being, I can work around it by passing an empty string, e.g. #puts("")

ksss commented 4 years ago

@ntl Thank you for reporting. I fixed in ee5df6e4c70e85aa29ac4d50afbc76e0f6fdf236

ntl commented 4 years ago

Thanks @ksss !