Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module JITSpecs | ||
class Tier1Specs | ||
def none | ||
nil | ||
end | ||
|
||
def one(arg) | ||
arg | ||
end | ||
|
||
def strlit | ||
"hello" | ||
end | ||
|
||
def str_build(obj) | ||
"-#{obj}-" | ||
end | ||
end | ||
end |
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,15 @@ | ||
require File.expand_path("../fixtures/tier1", __FILE__) | ||
|
||
describe "tier1 JIT" do | ||
before do | ||
@o = JITSpecs::Tier1Specs.new | ||
end | ||
|
||
it "can return a string literal" do | ||
@o.__send_tier1__(:strlit).should == "hello" | ||
end | ||
|
||
it "can build a string" do | ||
@o.__send_tier1__(:str_build, 1).should == "-1-" | ||
end | ||
end |