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
47a610e6
Commit
47a610e6
authored
Aug 30, 2013
by
Tomoyuki Sahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use array parameter on IO.open.
parent
713aa48c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
mrblib/io.rb
mrblib/io.rb
+3
-3
test/io.rb
test/io.rb
+20
-4
No files found.
mrblib/io.rb
View file @
47a610e6
...
@@ -11,8 +11,8 @@ class IO
...
@@ -11,8 +11,8 @@ class IO
BUF_SIZE
=
4096
BUF_SIZE
=
4096
def
self
.
open
(
fd
,
mode
=
"r"
,
opt
=
{}
,
&
block
)
def
self
.
open
(
*
args
,
&
block
)
io
=
self
.
new
(
fd
,
mode
,
opt
)
io
=
self
.
new
(
*
args
)
return
io
unless
block
return
io
unless
block
...
...
test/io.rb
View file @
47a610e6
##
##
# IO Test
# IO Test
assert
(
'IO TEST SETUP'
)
do
MRubyIOTestUtil
.
io_test_setup
end
assert
(
'IO'
,
'15.2.20'
)
do
assert
(
'IO'
,
'15.2.20'
)
do
assert_equal
(
Class
,
IO
.
class
)
assert_equal
(
Class
,
IO
.
class
)
end
end
...
@@ -13,6 +17,22 @@ assert('IO', '15.2.20.3') do
...
@@ -13,6 +17,22 @@ assert('IO', '15.2.20.3') do
assert_include
(
IO
.
included_modules
,
Enumerable
)
assert_include
(
IO
.
included_modules
,
Enumerable
)
end
end
assert
(
'IO.open'
,
'15.2.20.4.1'
)
do
fd
=
IO
.
sysopen
$mrbtest_io_rfname
assert_equal
Fixnum
,
fd
.
class
io
=
IO
.
open
fd
assert_equal
IO
,
io
.
class
assert_equal
$mrbtest_io_msg
+
"
\n
"
,
io
.
read
io
.
close
fd
=
IO
.
sysopen
$mrbtest_io_rfname
IO
.
open
(
fd
)
do
|
io
|
assert_equal
$mrbtest_io_msg
+
"
\n
"
,
io
.
read
end
true
end
assert
(
'IO.new'
)
do
assert
(
'IO.new'
)
do
IO
.
new
(
0
)
IO
.
new
(
0
)
end
end
...
@@ -21,10 +41,6 @@ assert('IO gc check') do
...
@@ -21,10 +41,6 @@ assert('IO gc check') do
100
.
times
{
IO
.
new
(
0
)
}
100
.
times
{
IO
.
new
(
0
)
}
end
end
assert
(
'IO TEST SETUP'
)
do
MRubyIOTestUtil
.
io_test_setup
end
assert
(
'IO.sysopen, IO#close, IO#closed?'
)
do
assert
(
'IO.sysopen, IO#close, IO#closed?'
)
do
fd
=
IO
.
sysopen
$mrbtest_io_rfname
fd
=
IO
.
sysopen
$mrbtest_io_rfname
assert_equal
Fixnum
,
fd
.
class
assert_equal
Fixnum
,
fd
.
class
...
...
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