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
06159708
Unverified
Commit
06159708
authored
Apr 29, 2019
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Apr 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4413 from shuujii/fix-missing-assertions-in-mruby-io-test
Fix missing assertions in `mruby-io` test
parents
b7ff23d2
8cc2ad33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
41 deletions
+36
-41
mrbgems/mruby-io/test/file.rb
mrbgems/mruby-io/test/file.rb
+4
-8
mrbgems/mruby-io/test/file_test.rb
mrbgems/mruby-io/test/file_test.rb
+2
-6
mrbgems/mruby-io/test/io.rb
mrbgems/mruby-io/test/io.rb
+30
-27
No files found.
mrbgems/mruby-io/test/file.rb
View file @
06159708
##
# File Test
assert
(
'File TEST SETUP'
)
do
MRubyIOTestUtil
.
io_test_setup
end
MRubyIOTestUtil
.
io_test_setup
assert
(
'File'
,
'15.2.21'
)
do
assert
(
'File
.class
'
,
'15.2.21'
)
do
assert_equal
Class
,
File
.
class
end
assert
(
'File'
,
'15.2.21.2'
)
do
assert
(
'File
.superclass
'
,
'15.2.21.2'
)
do
assert_equal
IO
,
File
.
superclass
end
...
...
@@ -204,6 +202,4 @@ assert('File.chmod') do
end
end
assert
(
'File TEST CLEANUP'
)
do
assert_nil
MRubyIOTestUtil
.
io_test_cleanup
end
MRubyIOTestUtil
.
io_test_cleanup
mrbgems/mruby-io/test/file_test.rb
View file @
06159708
##
# FileTest
assert
(
'FileTest TEST SETUP'
)
do
MRubyIOTestUtil
.
io_test_setup
end
MRubyIOTestUtil
.
io_test_setup
assert
(
"FileTest.directory?"
)
do
dir
=
MRubyIOTestUtil
.
mkdtemp
(
"mruby-io-test.XXXXXX"
)
...
...
@@ -112,6 +110,4 @@ assert("FileTest.zero?") do
assert_true
fp2
.
closed?
end
assert
(
'FileTest TEST CLEANUP'
)
do
assert_nil
MRubyIOTestUtil
.
io_test_cleanup
end
MRubyIOTestUtil
.
io_test_cleanup
mrbgems/mruby-io/test/io.rb
View file @
06159708
##
# IO Test
assert
(
'IO TEST SETUP'
)
do
MRubyIOTestUtil
.
io_test_setup
$cr
,
$crlf
,
$cmd
=
MRubyIOTestUtil
.
win?
?
[
1
,
"
\r\n
"
,
"cmd /c "
]
:
[
0
,
"
\n
"
,
""
]
MRubyIOTestUtil
.
io_test_setup
$cr
,
$crlf
,
$cmd
=
MRubyIOTestUtil
.
win?
?
[
1
,
"
\r\n
"
,
"cmd /c "
]
:
[
0
,
"
\n
"
,
""
]
assert_io_open
=
->
(
meth
)
do
fd
=
IO
.
sysopen
(
$mrbtest_io_rfname
)
assert_equal
Fixnum
,
fd
.
class
io1
=
IO
.
__send__
(
meth
,
fd
)
begin
assert_equal
IO
,
io1
.
class
assert_equal
$mrbtest_io_msg
,
io1
.
read
ensure
io1
.
close
end
io2
=
IO
.
__send__
(
meth
,
IO
.
sysopen
(
$mrbtest_io_rfname
))
do
|
io
|
if
meth
==
:open
assert_equal
$mrbtest_io_msg
,
io
.
read
else
flunk
"IO.
#{
meth
}
does not take block"
end
end
io2
.
close
unless
meth
==
:open
end
assert
(
'IO'
,
'15.2.20'
)
do
assert
(
'IO
.class
'
,
'15.2.20'
)
do
assert_equal
(
Class
,
IO
.
class
)
end
assert
(
'IO'
,
'15.2.20.2'
)
do
assert
(
'IO
.superclass
'
,
'15.2.20.2'
)
do
assert_equal
(
Object
,
IO
.
superclass
)
end
assert
(
'IO'
,
'15.2.20.3'
)
do
assert
(
'IO
.ancestors
'
,
'15.2.20.3'
)
do
assert_include
(
IO
.
ancestors
,
Enumerable
)
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
,
io
.
read
io
.
close
fd
=
IO
.
sysopen
$mrbtest_io_rfname
IO
.
open
(
fd
)
do
|
io
|
assert_equal
$mrbtest_io_msg
,
io
.
read
end
assert_io_open
.
(
:open
)
end
assert
(
'IO#close'
,
'15.2.20.5.1'
)
do
...
...
@@ -215,19 +224,15 @@ assert('IO#dup for writable') do
end
assert
(
'IO.for_fd'
)
do
fd
=
IO
.
sysopen
(
$mrbtest_io_rfname
)
io
=
IO
.
for_fd
(
fd
)
assert_equal
$mrbtest_io_msg
,
io
.
read
io
.
close
assert_io_open
.
(
:for_fd
)
end
assert
(
'IO.new'
)
do
io
=
IO
.
new
(
0
)
io
.
close
assert_io_open
.
(
:new
)
end
assert
(
'IO gc check'
)
do
100
.
times
{
IO
.
new
(
0
)
}
assert_nothing_raised
{
100
.
times
{
IO
.
new
(
0
)
}
}
end
assert
(
'IO.sysopen("./nonexistent")'
)
do
...
...
@@ -604,6 +609,4 @@ assert('`cmd`') do
end
end
assert
(
'IO TEST CLEANUP'
)
do
assert_nil
MRubyIOTestUtil
.
io_test_cleanup
end
MRubyIOTestUtil
.
io_test_cleanup
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