-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented rb_provided() and rb_feature_provided(). these come from …
…cRuby. (closes #1389)
- Loading branch information
Kouji Takao
committed
Sep 19, 2011
1 parent
8fe26ff
commit 31dffc8
Showing
4 changed files
with
215 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,4 @@ test/test-mri/result | |
test/test-mri/test/csv/temp.gz | ||
y.tab.c | ||
test-mri/result | ||
test_vm/zzz.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
assert ':ok', %{ | ||
File.unlink('zzz.rb') if File.file?('zzz.rb') | ||
instance_eval do | ||
autoload :ZZZ, './zzz.rb' | ||
begin | ||
ZZZ | ||
rescue LoadError | ||
p :ok | ||
end | ||
end | ||
} | ||
|
||
assert ':ok', %{ | ||
open('zzz.rb', 'w') {|f| f.puts '' } | ||
instance_eval do | ||
autoload :ZZZ, './zzz.rb' | ||
begin | ||
ZZZ | ||
rescue NameError | ||
p :ok | ||
end | ||
end | ||
} | ||
|
||
assert ':ok', %{ | ||
open('zzz.rb', 'w') {|f| f.puts 'class ZZZ; def self.ok; :ok;end;end'} | ||
instance_eval do | ||
autoload :ZZZ, './zzz.rb' | ||
p ZZZ.ok | ||
end | ||
} | ||
|
||
assert ':ok', %{ | ||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | ||
autoload :ZZZ, "./zzz.rb" | ||
p ZZZ.ok | ||
} | ||
|
||
assert ':ok', %{ | ||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | ||
autoload :ZZZ, "./zzz.rb" | ||
require "./zzz.rb" | ||
p ZZZ.ok | ||
} | ||
|
||
assert ':ok', %{ | ||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | ||
autoload :ZZZ, "zzz.rb" | ||
require "zzz.rb" | ||
p ZZZ.ok | ||
} | ||
|
||
assert '"okok"', %{ | ||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | ||
autoload :ZZZ, "./zzz.rb" | ||
t1 = Thread.new {ZZZ.ok} | ||
t2 = Thread.new {ZZZ.ok} | ||
p [t1.value, t2.value].join | ||
}, :known_bug => true |