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
31e97050
Commit
31e97050
authored
May 29, 2012
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Test cases for Literals, Enumeration, Exceptions and clean line endings
parent
ec3944d9
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
77 additions
and
33 deletions
+77
-33
test/t/argumenterror.rb
test/t/argumenterror.rb
+10
-2
test/t/array.rb
test/t/array.rb
+38
-4
test/t/bs_block.rb
test/t/bs_block.rb
+0
-1
test/t/bs_literal.rb
test/t/bs_literal.rb
+0
-1
test/t/enumerable.rb
test/t/enumerable.rb
+29
-0
test/t/false.rb
test/t/false.rb
+0
-1
test/t/float.rb
test/t/float.rb
+0
-1
test/t/hash.rb
test/t/hash.rb
+0
-1
test/t/indexerror.rb
test/t/indexerror.rb
+0
-1
test/t/integer.rb
test/t/integer.rb
+0
-1
test/t/kernel.rb
test/t/kernel.rb
+0
-1
test/t/localjumperror.rb
test/t/localjumperror.rb
+0
-1
test/t/module.rb
test/t/module.rb
+0
-1
test/t/nameerror.rb
test/t/nameerror.rb
+0
-1
test/t/nil.rb
test/t/nil.rb
+0
-1
test/t/nomethoderror.rb
test/t/nomethoderror.rb
+0
-1
test/t/numeric.rb
test/t/numeric.rb
+0
-1
test/t/object.rb
test/t/object.rb
+0
-1
test/t/proc.rb
test/t/proc.rb
+0
-1
test/t/range.rb
test/t/range.rb
+0
-1
test/t/rangeerror.rb
test/t/rangeerror.rb
+0
-1
test/t/regexperror.rb
test/t/regexperror.rb
+0
-1
test/t/runtimeerror.rb
test/t/runtimeerror.rb
+0
-1
test/t/standarderror.rb
test/t/standarderror.rb
+0
-1
test/t/string.rb
test/t/string.rb
+0
-1
test/t/struct.rb
test/t/struct.rb
+0
-1
test/t/symbol.rb
test/t/symbol.rb
+0
-1
test/t/time.rb
test/t/time.rb
+0
-1
test/t/true.rb
test/t/true.rb
+0
-1
test/t/typeerror.rb
test/t/typeerror.rb
+0
-1
No files found.
test/t/argumenterror.rb
View file @
31e97050
...
...
@@ -2,6 +2,14 @@
# ArgumentError ISO Test
assert
(
'ArgumentError'
,
'15.2.24'
)
do
ArgumentError
.
class
==
Class
end
e2
=
nil
a
=
[]
begin
# this will cause an exception due to the wrong arguments
a
[]
rescue
=>
e1
e2
=
e1
end
ArgumentError
.
class
==
Class
and
e2
.
class
==
ArgumentError
end
test/t/array.rb
View file @
31e97050
...
...
@@ -22,11 +22,47 @@ assert('Array#<<', '15.2.12.5.3') do
end
assert
(
'Array#[]'
,
'15.2.12.5.4'
)
do
[
1
,
2
,
3
].
[
](
1
)
==
2
e2
=
nil
e3
=
nil
a
=
Array
.
new
begin
# this will cause an exception due to the wrong arguments
a
.
[
]()
rescue
=>
e1
e2
=
e1
end
begin
# this will cause an exception due to the wrong arguments
a
.
[
](
1
,
2
,
3
)
rescue
=>
e1
e3
=
e1
end
[
1
,
2
,
3
].
[
](
1
)
==
2
and
e2
.
class
==
ArgumentError
and
e3
.
class
==
ArgumentError
end
assert
(
'Array#[]='
,
'15.2.12.5.5'
)
do
[
1
,
2
,
3
].
[
]
=
(
1
,
4
)
==
[
1
,
4
,
3
]
e2
=
nil
e3
=
nil
a
=
Array
.
new
begin
# this will cause an exception due to the wrong arguments
a
.
[
]
=
()
rescue
=>
e1
e2
=
e1
end
begin
# this will cause an exception due to the wrong arguments
a
.
[
]
=
(
1
,
2
,
3
,
4
)
rescue
=>
e1
e3
=
e1
end
[
1
,
2
,
3
].
[
]
=
(
1
,
4
)
==
[
1
,
4
,
3
]
and
e2
.
class
==
ArgumentError
and
e3
.
class
==
ArgumentError
end
assert
(
'Array#clear'
,
'15.2.12.5.6'
)
do
...
...
@@ -193,5 +229,3 @@ assert('Array#unshift', '15.2.12.5.30') do
end
# Not ISO specified
test/t/bs_block.rb
View file @
31e97050
...
...
@@ -388,4 +388,3 @@ assert('BS Block [ruby-core:14395]') do
t
=
Controller
.
new
t
.
test_for_bug
end
test/t/bs_literal.rb
View file @
31e97050
...
...
@@ -36,4 +36,3 @@ end
assert
(
'BS Literal 9'
)
do
Fixnum
==
1234
.
class
end
test/t/enumerable.rb
View file @
31e97050
...
...
@@ -72,3 +72,32 @@ assert('Enumerable#min', '15.3.2.2.14') do
a
.
min
{
|
i1
,
i2
|
i1
.
length
<=>
i2
.
length
}
==
'c'
end
assert
(
'Enumerable#member?'
,
'15.3.2.2.15'
)
do
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
].
member?
(
5
)
and
not
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
].
member?
(
0
)
end
assert
(
'Enumerable#partion'
,
'15.3.2.2.16'
)
do
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
].
partition
do
|
i
|
i
%
2
==
0
end
==
[[
0
,
2
,
4
,
6
,
8
],
[
1
,
3
,
5
,
7
,
9
]]
end
assert
(
'Enumerable#reject'
,
'15.3.2.2.17'
)
do
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
].
reject
do
|
i
|
i
%
2
==
0
end
==
[
1
,
3
,
5
,
7
,
9
]
end
assert
(
'Enumerable#select'
,
'15.3.2.2.18'
)
do
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
].
select
()
{
|
i
|
i
%
2
==
0
}
==
[
2
,
4
,
6
,
8
]
end
assert
(
'Enumerable#sort'
,
'15.3.2.2.19'
)
do
[
7
,
3
,
1
,
2
,
6
,
4
].
sort
==
[
1
,
2
,
3
,
4
,
6
,
7
]
and
[
7
,
3
,
1
,
2
,
6
,
4
].
sort
{
|
e1
,
e2
|
e2
<=>
e1
}
==
[
7
,
6
,
4
,
3
,
2
,
1
]
end
assert
(
'Enumerable#to_a'
,
'15.3.2.2.20'
)
do
[
1
].
to_a
==
[
1
]
end
test/t/false.rb
View file @
31e97050
...
...
@@ -24,4 +24,3 @@ end
assert
(
'FalseClass#|'
,
'15.2.6.3.4'
)
do
FalseClass
.
new
.|
(
true
)
and
not
FalseClass
.
new
.|
(
false
)
end
test/t/float.rb
View file @
31e97050
...
...
@@ -99,4 +99,3 @@ end
assert
(
'Float#truncate'
,
'15.2.9.3.15'
)
do
3.123456789
.
truncate
==
3
end
test/t/hash.rb
View file @
31e97050
...
...
@@ -224,4 +224,3 @@ assert('Hash#values', '15.2.13.4.28') do
a
.
values
==
[
'abc_value'
]
end
test/t/indexerror.rb
View file @
31e97050
...
...
@@ -4,4 +4,3 @@
assert
(
'IndexError'
,
'15.2.33'
)
do
IndexError
.
class
==
Class
end
test/t/integer.rb
View file @
31e97050
...
...
@@ -168,4 +168,3 @@ assert('Integer#upto', '15.2.8.3.27') do
end
a
==
6
end
test/t/kernel.rb
View file @
31e97050
...
...
@@ -122,4 +122,3 @@ assert('Kernel#to_s', '15.3.1.2.46') do
# TODO looks strange..
to_s
==
''
end
test/t/localjumperror.rb
View file @
31e97050
...
...
@@ -7,4 +7,3 @@ end
# TODO 15.2.25.2.1 LocalJumpError#exit_value
# TODO 15.2.25.2.2 LocalJumpError#reason
test/t/module.rb
View file @
31e97050
...
...
@@ -8,4 +8,3 @@ end
# TODO not implemented ATM assert('Module.constants', '15.2.2') do
# TODO not implemented ATM assert('Module.nesting', '15.2.2') do
test/t/nameerror.rb
View file @
31e97050
...
...
@@ -12,4 +12,3 @@ assert('NameError#initialize', '15.2.31.2.2') do
e
.
class
==
NameError
and
e
.
message
==
'a'
end
test/t/nil.rb
View file @
31e97050
...
...
@@ -24,4 +24,3 @@ end
assert
(
'NilClass#to_s'
,
'15.2.4.3.5'
)
do
NilClass
.
new
.
to_s
==
''
end
test/t/nomethoderror.rb
View file @
31e97050
...
...
@@ -11,4 +11,3 @@ assert('NoMethodError', '15.2.32') do
NoMethodError
.
class
==
Class
and
e2
.
class
==
NoMethodError
end
test/t/numeric.rb
View file @
31e97050
...
...
@@ -22,4 +22,3 @@ end
assert
(
'Numeric#**'
)
do
2.0
**
3
==
8.0
end
test/t/object.rb
View file @
31e97050
...
...
@@ -4,4 +4,3 @@
assert
(
'Object'
,
'15.2.1'
)
do
Object
.
class
==
Class
end
test/t/proc.rb
View file @
31e97050
...
...
@@ -42,4 +42,3 @@ assert('Proc#call', '15.2.17.4.3') do
a
==
1
and
a2
==
5
end
test/t/range.rb
View file @
31e97050
...
...
@@ -62,4 +62,3 @@ assert('Range#member?', '15.2.14.4.11') do
a
.
member?
(
5
)
and
not
a
.
member?
(
20
)
end
test/t/rangeerror.rb
View file @
31e97050
...
...
@@ -4,4 +4,3 @@
assert
(
'RangeError'
,
'15.2.26'
)
do
RangeError
.
class
==
Class
end
test/t/regexperror.rb
View file @
31e97050
...
...
@@ -2,4 +2,3 @@
# RegexpError ISO Test
# TODO broken ATM assert('RegexpError', '15.2.27') do
test/t/runtimeerror.rb
View file @
31e97050
...
...
@@ -12,4 +12,3 @@ assert('RuntimeError', '15.2.28') do
RuntimeError
.
class
==
Class
and
e2
.
class
==
RuntimeError
end
test/t/standarderror.rb
View file @
31e97050
...
...
@@ -4,4 +4,3 @@
assert
(
'StandardError'
,
'15.2.23'
)
do
StandardError
.
class
==
Class
end
test/t/string.rb
View file @
31e97050
...
...
@@ -319,4 +319,3 @@ assert('String#upcase!', '15.2.10.5.43') do
a
==
'ABC'
end
test/t/struct.rb
View file @
31e97050
...
...
@@ -4,4 +4,3 @@
assert
(
'Struct'
,
'15.2.18'
)
do
Struct
.
class
==
Class
end
test/t/symbol.rb
View file @
31e97050
...
...
@@ -20,4 +20,3 @@ end
assert
(
'Symbol#to_sym'
,
'15.2.11.3.4'
)
do
:abc
.
to_sym
==
:abc
end
test/t/time.rb
View file @
31e97050
...
...
@@ -71,4 +71,3 @@ end
assert
(
'Time#new'
)
do
Time
.
new
.
class
==
Time
end
test/t/true.rb
View file @
31e97050
...
...
@@ -24,4 +24,3 @@ end
assert
(
'TrueClass#|'
,
'15.2.5.3.4'
)
do
TrueClass
.
new
.|
(
true
)
and
TrueClass
.
new
.|
(
false
)
end
test/t/typeerror.rb
View file @
31e97050
...
...
@@ -4,4 +4,3 @@
assert
(
'TypeError'
,
'15.2.29'
)
do
TypeError
.
class
==
Class
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