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
7dae0ec7
Unverified
Commit
7dae0ec7
authored
Jul 30, 2019
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Jul 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4606 from shuujii/refine-message-to-skip-in-nested-assert
Refine message to `skip` in nested `assert`
parents
428e34ab
44381f0a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
11 deletions
+11
-11
mrbgems/mruby-bin-mruby/bintest/mruby.rb
mrbgems/mruby-bin-mruby/bintest/mruby.rb
+1
-1
mrbgems/mruby-complex/test/complex.rb
mrbgems/mruby-complex/test/complex.rb
+1
-1
mrbgems/mruby-io/test/io.rb
mrbgems/mruby-io/test/io.rb
+1
-1
mrbgems/mruby-pack/test/pack.rb
mrbgems/mruby-pack/test/pack.rb
+1
-1
mrbgems/mruby-rational/test/rational.rb
mrbgems/mruby-rational/test/rational.rb
+2
-2
test/assert.rb
test/assert.rb
+4
-4
test/t/numeric.rb
test/t/numeric.rb
+1
-1
No files found.
mrbgems/mruby-bin-mruby/bintest/mruby.rb
View file @
7dae0ec7
...
...
@@ -3,7 +3,7 @@ require 'open3'
def
assert_mruby
(
exp_out
,
exp_err
,
exp_success
,
args
)
out
,
err
,
stat
=
Open3
.
capture3
(
cmd
(
"mruby"
),
*
args
)
assert
do
assert
"assert_mruby"
do
assert_operator
(
exp_out
,
:===
,
out
,
"standard output"
)
assert_operator
(
exp_err
,
:===
,
err
,
"standard error"
)
assert_equal
(
exp_success
,
stat
.
success?
,
"exit success?"
)
...
...
mrbgems/mruby-complex/test/complex.rb
View file @
7dae0ec7
def
assert_complex
(
real
,
exp
)
assert
do
assert
"assert_complex"
do
assert_float
real
.
real
,
exp
.
real
assert_float
real
.
imaginary
,
exp
.
imaginary
end
...
...
mrbgems/mruby-io/test/io.rb
View file @
7dae0ec7
...
...
@@ -5,7 +5,7 @@ MRubyIOTestUtil.io_test_setup
$cr
,
$crlf
,
$cmd
=
MRubyIOTestUtil
.
win?
?
[
1
,
"
\r\n
"
,
"cmd /c "
]
:
[
0
,
"
\n
"
,
""
]
def
assert_io_open
(
meth
)
assert
do
assert
"assert_io_open"
do
fd
=
IO
.
sysopen
(
$mrbtest_io_rfname
)
assert_equal
Fixnum
,
fd
.
class
io1
=
IO
.
__send__
(
meth
,
fd
)
...
...
mrbgems/mruby-pack/test/pack.rb
View file @
7dae0ec7
...
...
@@ -2,7 +2,7 @@ PACK_IS_LITTLE_ENDIAN = "\x01\00".unpack('S')[0] == 0x01
def
assert_pack
tmpl
,
packed
,
unpacked
t
=
tmpl
.
inspect
assert
do
assert
"assert_pack"
do
assert_equal
packed
,
unpacked
.
pack
(
tmpl
),
"
#{
unpacked
.
inspect
}
.pack(
#{
t
}
)"
assert_equal
unpacked
,
packed
.
unpack
(
tmpl
),
"
#{
packed
.
inspect
}
.unpack(
#{
t
}
)"
end
...
...
mrbgems/mruby-rational/test/rational.rb
View file @
7dae0ec7
...
...
@@ -23,14 +23,14 @@ class ComplexLikeNumeric < UserDefinedNumeric
end
def
assert_rational
(
exp
,
real
)
assert
do
assert
"assert_rational"
do
assert_float
exp
.
numerator
,
real
.
numerator
assert_float
exp
.
denominator
,
real
.
denominator
end
end
def
assert_equal_rational
(
exp
,
o1
,
o2
)
assert
do
assert
"assert_equal_rational"
do
if
exp
assert_operator
(
o1
,
:==
,
o2
)
assert_not_operator
(
o1
,
:
!=
,
o2
)
...
...
test/assert.rb
View file @
7dae0ec7
...
...
@@ -76,7 +76,7 @@ end
# iso : The ISO reference code of the feature
# which will be tested by this
# assertion
def
assert
(
str
=
'
Assertion failed
'
,
iso
=
''
)
def
assert
(
str
=
'
assert
'
,
iso
=
''
)
t_print
(
str
,
(
iso
!=
''
?
" [
#{
iso
}
]"
:
''
),
' : '
)
if
$mrbtest_verbose
begin
$mrbtest_child_noassert
||=
[
0
]
...
...
@@ -99,10 +99,10 @@ def assert(str = 'Assertion failed', iso = '')
yield
if
$mrbtest_assert
.
size
>
0
if
$mrbtest_assert
.
size
==
$mrbtest_child_noassert
[
-
1
]
$asserts
.
push
(
assertion_string
(
'
Info
: '
,
str
,
iso
))
$asserts
.
push
(
assertion_string
(
'
Skip
: '
,
str
,
iso
))
$mrbtest_child_noassert
[
-
2
]
+=
1
$
ok
_test
+=
1
t_print
(
'
.
'
)
$
skip
_test
+=
1
t_print
(
'
?
'
)
else
$asserts
.
push
(
assertion_string
(
'Fail: '
,
str
,
iso
))
$ko_test
+=
1
...
...
test/t/numeric.rb
View file @
7dae0ec7
...
...
@@ -8,7 +8,7 @@ def assert_step(exp, receiver, args, inf: false)
break
if
inf
&&
exp
.
size
==
act
.
size
end
expr
=
"
#{
receiver
.
inspect
}
.step(
#{
args
.
map
(
&
:inspect
).
join
(
', '
)
}
)"
assert
do
assert
"assert_step"
do
assert_true
(
exp
.
eql?
(
act
),
"
#{
expr
}
: counters"
,
assertion_diff
(
exp
,
act
))
assert_same
(
receiver
,
ret
,
"
#{
expr
}
: return value"
)
unless
inf
end
...
...
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