summaryrefslogtreecommitdiffstats
path: root/sample/test.rb
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
commitb77b7c30d4855734384a095db41a734d315bb8fa (patch)
treeae6cd78921bf626d54145b5485474bf59c3dceb4 /sample/test.rb
parentff338e4e581cc264abf4c5bfd3501bb77c16335f (diff)
downloadruby-b77b7c30d4855734384a095db41a734d315bb8fa.tar.gz
ruby-b77b7c30d4855734384a095db41a734d315bb8fa.tar.xz
ruby-b77b7c30d4855734384a095db41a734d315bb8fa.zip
2000-02-01
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 53783d145..ac668172c 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