summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-02-17 16:09:11 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-02-17 16:09:11 -0800
commit794406145344ee956ac024f07c37f9e011fbfa28 (patch)
tree158590ba6d0c3114f696e85a87c8b892bc2a9e03 /test
parent7ef927e099078c4a8cce90b5200d4ef3f17bf681 (diff)
parente8c0b61c0decc9bab480b59dc98075c34259a0d8 (diff)
downloadmruby-794406145344ee956ac024f07c37f9e011fbfa28.tar.gz
mruby-794406145344ee956ac024f07c37f9e011fbfa28.zip
Merge pull request #847 from bovi/gsub
String#gsub fix with last character
Diffstat (limited to 'test')
-rw-r--r--test/t/string.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/t/string.rb b/test/t/string.rb
index fac77075b..7d0b147d0 100644
--- a/test/t/string.rb
+++ b/test/t/string.rb
@@ -193,7 +193,9 @@ assert('String#eql?', '15.2.10.5.17') do
end
assert('String#gsub', '15.2.10.5.18') do
- 'abcabc'.gsub('b', 'B') == 'aBcaBc' && 'abcabc'.gsub('b') { |w| w.capitalize } == 'aBcaBc'
+ 'abcabc'.gsub('b', 'B') == 'aBcaBc' and
+ 'abcabc'.gsub('b') { |w| w.capitalize } == 'aBcaBc' and
+ '#a#a#'.gsub('#', '$') == '$a$a$'
end
assert('String#gsub!', '15.2.10.5.19') do
@@ -318,7 +320,9 @@ assert('String#split', '15.2.10.5.35') do
end
assert('String#sub', '15.2.10.5.36') do
- 'abcabc'.sub('b', 'B') == 'aBcabc' && 'abcabc'.sub('b') { |w| w.capitalize } == 'aBcabc'
+ 'abcabc'.sub('b', 'B') == 'aBcabc' and
+ 'abcabc'.sub('b') { |w| w.capitalize } == 'aBcabc' and
+ 'aa#'.sub('#', '$') == 'aa$'
end
assert('String#sub!', '15.2.10.5.37') do