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
fab781cf
Commit
fab781cf
authored
Sep 11, 2019
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop test dependency from `mruby-string-ext` to `mruby-enumerator`
parent
896f3fe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
mrbgems/mruby-string-ext/mrbgem.rake
mrbgems/mruby-string-ext/mrbgem.rake
+0
-1
mrbgems/mruby-string-ext/test/string.rb
mrbgems/mruby-string-ext/test/string.rb
+14
-9
No files found.
mrbgems/mruby-string-ext/mrbgem.rake
View file @
fab781cf
...
...
@@ -2,5 +2,4 @@ MRuby::Gem::Specification.new('mruby-string-ext') do |spec|
spec
.
license
=
'MIT'
spec
.
author
=
'mruby developers'
spec
.
summary
=
'String class extension'
spec
.
add_test_dependency
'mruby-enumerator'
,
core:
'mruby-enumerator'
end
mrbgems/mruby-string-ext/test/string.rb
View file @
fab781cf
...
...
@@ -4,6 +4,12 @@
UTF8STRING
=
__ENCODING__
==
"UTF-8"
def
assert_upto
(
exp
,
receiver
,
*
args
)
act
=
[]
receiver
.
upto
(
*
args
)
{
|
v
|
act
<<
v
}
assert_equal
exp
,
act
end
assert
(
'String#getbyte'
)
do
str1
=
"hello"
bytes1
=
[
104
,
101
,
108
,
108
,
111
]
...
...
@@ -591,16 +597,15 @@ assert('String#rjust should raise on zero width padding') do
end
assert
(
'String#upto'
)
do
assert_equal
%w(a8 a9 b0 b1 b2 b3 b4 b5 b6)
,
"a8"
.
upto
(
"b6"
).
to_a
assert_equal
[
"9"
,
"10"
,
"11"
],
"9"
.
upto
(
"11"
).
to_a
assert_equal
[],
"25"
.
upto
(
"5"
).
to_a
assert_equal
[
"07"
,
"08"
,
"09"
,
"10"
,
"11"
],
"07"
.
upto
(
"11"
).
to_a
assert_upto
%w(a8 a9 b0 b1 b2 b3 b4 b5 b6)
,
"a8"
,
"b6"
assert_upto
[
"9"
,
"10"
,
"11"
],
"9"
,
"11"
assert_upto
[],
"25"
,
"5"
assert_upto
[
"07"
,
"08"
,
"09"
,
"10"
,
"11"
],
"07"
,
"11"
assert_upto
[
"9"
,
":"
,
";"
,
"<"
,
"="
,
">"
,
"?"
,
"@"
,
"A"
],
"9"
,
"A"
if
UTF8STRING
assert_equal
[
"あ"
,
"ぃ"
,
"い"
,
"ぅ"
,
"う"
,
"ぇ"
,
"え"
,
"ぉ"
,
"お"
],
"あ"
.
upto
(
"お"
).
to_a
end
assert_equal
[
"9"
,
":"
,
";"
,
"<"
,
"="
,
">"
,
"?"
,
"@"
,
"A"
],
"9"
.
upto
(
"A"
).
to_a
if
UTF8STRING
assert_upto
%w(あ ぃ い ぅ う ぇ え ぉ お)
,
"あ"
,
"お"
end
a
=
"aa"
start
=
"aa"
...
...
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