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
9bbfc38b
Commit
9bbfc38b
authored
Sep 27, 2015
by
takahashim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add IO#rewind
parent
1d6b7f9b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
mrblib/io.rb
mrblib/io.rb
+4
-0
test/io.rb
test/io.rb
+11
-0
No files found.
mrblib/io.rb
View file @
9bbfc38b
...
...
@@ -141,6 +141,10 @@ class IO
seek
(
i
,
SEEK_SET
)
end
def
rewind
seek
(
0
,
SEEK_SET
)
end
def
seek
(
i
,
whence
=
SEEK_SET
)
raise
IOError
if
closed?
@pos
=
sysseek
(
i
,
whence
)
...
...
test/io.rb
View file @
9bbfc38b
...
...
@@ -256,6 +256,17 @@ assert('IO#pos=, IO#seek') do
io
.
closed?
end
assert
(
'IO#rewind'
)
do
fd
=
IO
.
sysopen
$mrbtest_io_rfname
io
=
IO
.
new
fd
assert_equal
'm'
,
io
.
getc
assert_equal
1
,
io
.
pos
assert_equal
0
,
io
.
rewind
assert_equal
0
,
io
.
pos
io
.
close
io
.
closed?
end
assert
(
'IO#gets'
)
do
fd
=
IO
.
sysopen
$mrbtest_io_rfname
io
=
IO
.
new
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