Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
1d6b7f9b
Commit
1d6b7f9b
authored
Sep 27, 2015
by
Tomoyuki Sahara
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #44 from takahashim/io-addstr
support IO#<<
parents
6c4d3941
c26f998e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
mrblib/io.rb
mrblib/io.rb
+5
-0
test/io.rb
test/io.rb
+8
-0
No files found.
mrblib/io.rb
View file @
1d6b7f9b
...
@@ -108,6 +108,11 @@ class IO
...
@@ -108,6 +108,11 @@ class IO
raise
IOError
raise
IOError
end
end
def
<<
(
str
)
write
(
str
)
self
end
def
eof?
def
eof?
return
true
if
@buf
&&
@buf
.
size
>
0
return
true
if
@buf
&&
@buf
.
size
>
0
...
...
test/io.rb
View file @
1d6b7f9b
...
@@ -150,6 +150,14 @@ assert('IO#write', '15.2.20.5.20') do
...
@@ -150,6 +150,14 @@ assert('IO#write', '15.2.20.5.20') do
true
true
end
end
assert
(
'IO#<<'
)
do
io
=
IO
.
open
(
IO
.
sysopen
(
$mrbtest_io_wfname
))
io
<<
""
<<
""
assert_equal
0
,
io
.
pos
io
.
close
true
end
assert
(
'IO.for_fd'
)
do
assert
(
'IO.for_fd'
)
do
fd
=
IO
.
sysopen
(
$mrbtest_io_rfname
)
fd
=
IO
.
sysopen
(
$mrbtest_io_rfname
)
io
=
IO
.
for_fd
(
fd
)
io
=
IO
.
for_fd
(
fd
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment