summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
commite4b53b22228d935847b72e8f9ab0f49a15b54215 (patch)
treeae6cd78921bf626d54145b5485474bf59c3dceb4 /sample
parent005f12582975d8382851b740690f97dba35aaa2a (diff)
2000-02-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/test.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 53783d145e..ac668172c7 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -137,7 +137,9 @@ tmp.close
$bad = false
tmp = open("while_tmp", "r")
while tmp.gets()
- if gsub!('vt100', 'VT100')
+ line = $_
+ $_ = gsub(/vt100/, 'VT100')
+ if $_ != line
gsub!('VT100', 'Vt100')
redo;
end
@@ -677,7 +679,8 @@ ok("a".upcase![0] == ?A)
ok("A".downcase![0] == ?a)
ok("abc".tr!("a-z", "A-Z") == "ABC")
ok("aabbcccc".tr_s!("a-z", "A-Z") == "ABC")
-ok("abc".tr!("0-9", "A-Z") == nil)
+$x = "abc"
+ok($x.tr("0-9", "A-Z").equal?($x))
ok("abcc".squeeze!("a-z") == "abc")
ok("abcd".delete!("bc") == "ad")
@@ -965,6 +968,7 @@ File.unlink "script_tmp.bak" or `/bin/rm -f "script_tmp.bak"`
$bad = false
for script in Dir["{lib,sample}/*.rb"]
unless `./miniruby -c #{script}`.chomp == "Syntax OK"
+ p `./miniruby -c #{script}`.chomp
$bad = true
end
end
@@ -1009,7 +1013,7 @@ ok(foo.test == "test")
begin
foo.test2
ok false
-rescue
+rescue NameError
ok true
end
@@ -1061,7 +1065,7 @@ ok($$.instance_of?(Fixnum))
begin
$$ = 5
ok false
-rescue
+rescue NameError
ok true
end