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
d3a057ca
Commit
d3a057ca
authored
Jan 16, 2014
by
Carson McDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase test coverage of mruby-struct
parent
38973f15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
mrbgems/mruby-struct/test/struct.rb
mrbgems/mruby-struct/test/struct.rb
+29
-1
No files found.
mrbgems/mruby-struct/test/struct.rb
View file @
d3a057ca
...
...
@@ -73,5 +73,33 @@ if Object.const_defined?(:Struct)
cc
=
c
.
new
(
1
,
2
)
cc
.
select
{
|
v
|
v
%
2
==
0
}
==
[
2
]
end
end
assert
(
'large struct'
)
do
c
=
Struct
.
new
(
:m1
,
:m2
,
:m3
,
:m4
,
:m5
,
:m6
,
:m7
,
:m8
,
:m9
,
:m10
,
:m11
,
:m12
,
:m13
)
cc
=
c
.
new
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
)
assert_equal
1
,
cc
.
m1
assert_equal
2
,
cc
.
m2
assert_equal
3
,
cc
.
m3
assert_equal
4
,
cc
.
m4
assert_equal
5
,
cc
.
m5
assert_equal
6
,
cc
.
m6
assert_equal
7
,
cc
.
m7
assert_equal
8
,
cc
.
m8
assert_equal
9
,
cc
.
m9
assert_equal
10
,
cc
.
m10
assert_equal
13
,
cc
.
m13
end
assert
(
'wrong struct arg count'
)
do
c
=
Struct
.
new
(
:m1
)
assert_raise
ArgumentError
do
cc
=
c
.
new
(
1
,
2
,
3
)
end
end
assert
(
'struct inspect'
)
do
c
=
Struct
.
new
(
:m1
,
:m2
,
:m3
,
:m4
,
:m5
)
cc
=
c
.
new
(
1
,
2
,
3
,
4
,
5
)
assert_equal
"#<struct
#{
c
.
inspect
}
m1=1, m2=2, m3=3, m4=4, m5=5>"
,
cc
.
inspect
end
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