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
d1b131e2
Commit
d1b131e2
authored
Apr 06, 2013
by
Masaki Muranaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some tests.
parent
e885e59d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
test/t/comparable.rb
test/t/comparable.rb
+15
-0
test/t/kernel.rb
test/t/kernel.rb
+22
-1
test/t/module.rb
test/t/module.rb
+23
-0
No files found.
test/t/comparable.rb
View file @
d1b131e2
...
...
@@ -54,3 +54,18 @@ assert('Comparable#>=', '15.3.3.2.5') do
(
Foo
.
new
>=
Foo
.
new
)
==
true
end
assert
(
'Comparable#between?'
,
'15.3.3.2.6'
)
do
class
Foo
include
Comparable
def
<
=>
(
x
)
x
end
end
c
=
Foo
.
new
c
.
between?
(
-
1
,
1
)
==
false
&&
c
.
between?
(
-
1
,
-
1
)
==
false
&&
c
.
between?
(
1
,
1
)
==
false
&&
c
.
between?
(
1
,
-
1
)
==
true
&&
c
.
between?
(
0
,
0
)
==
true
end
test/t/kernel.rb
View file @
d1b131e2
...
...
@@ -155,6 +155,16 @@ assert('Kernel#clone', '15.3.1.3.8') do
a
.
set
(
2
)
c
=
a
.
clone
immutables
=
[
1
,
:foo
,
true
,
false
,
nil
]
error_count
=
0
immutables
.
each
do
|
i
|
begin
i
.
clone
rescue
TypeError
error_count
+=
1
end
end
a
.
get
==
2
and
b
.
get
==
1
and
c
.
get
==
2
&&
a
.
respond_to?
(
:test
)
==
true
and
b
.
respond_to?
(
:test
)
==
false
and
...
...
@@ -185,7 +195,18 @@ assert('Kernel#dup', '15.3.1.3.9') do
a
.
set
(
2
)
c
=
a
.
dup
a
.
get
==
2
and
b
.
get
==
1
and
c
.
get
==
2
and
immutables
=
[
1
,
:foo
,
true
,
false
,
nil
]
error_count
=
0
immutables
.
each
do
|
i
|
begin
i
.
dup
rescue
TypeError
error_count
+=
1
end
end
error_count
==
immutables
.
size
and
a
.
get
==
2
and
b
.
get
==
1
and
c
.
get
==
2
and
a
.
respond_to?
(
:test
)
==
true
and
b
.
respond_to?
(
:test
)
==
false
and
c
.
respond_to?
(
:test
)
==
false
...
...
test/t/module.rb
View file @
d1b131e2
...
...
@@ -297,6 +297,29 @@ assert('Module#remove_method', '15.2.2.4.41') do
not
Test4RemoveMethod
::
Child
.
instance_methods
(
false
).
include?
:hello
end
assert
(
'Module.undef_method'
,
'15.2.2.4.42'
)
do
module
Test4UndefMethod
class
Parent
def
hello
end
end
class
Child
<
Parent
def
hello
end
end
class
GrandChild
<
Child
end
end
Test4UndefMethod
::
Child
.
class_eval
{
undef_method
:hello
}
Test4UndefMethod
::
Parent
.
new
.
respond_to?
(
:hello
)
and
not
Test4UndefMethod
::
Child
.
new
.
respond_to?
(
:hello
)
and
not
Test4UndefMethod
::
GrandChild
.
new
.
respond_to?
(
:hello
)
end
# Not ISO specified
...
...
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