Skip to content
Browse files

More specs.

  • Loading branch information...
1 parent 8dd5d41 commit 893233cca49571bd785cfc194a322a949efd313e @whitequark committed Mar 20, 2013
Showing with 20 additions and 4 deletions.
  1. +20 −4 test/test_ssa.rb
View
24 test/test_ssa.rb
@@ -286,6 +286,8 @@ def insn_binary(basic_block, left, right)
i.remove
@basic_block.to_a.should.be.empty
+
+ i.awesome_print.should =~ /\^Binding %\d+ = binding <DETACHED>/
end
it 'replaces uses of itself with instructions' do
@@ -436,16 +438,30 @@ def i.exits?; true; end
end
describe SSA::ReturnInsn do
+ before do
+ @i = SSA::ReturnInsn.new(@basic_block)
+ end
+
it 'exits the method' do
- i = SSA::ReturnInsn.new(@basic_block)
- i.exits?.should == true
+ @i.exits?.should == true
+ end
+
+ it 'returns bottom in #value_type' do
+ @i.value_type.should == Type::Bottom.new
end
end
describe SSA::ReturnValueInsn do
+ before do
+ @i = SSA::ReturnValueInsn.new(@basic_block, [SSA::Constant.new(Integer, 1)])
+ end
+
it 'exits the method' do
- i = SSA::ReturnValueInsn.new(@basic_block, [SSA::Constant.new(Integer, 1)])
- i.exits?.should == true
+ @i.exits?.should == true
+ end
+
+ it 'returns value type in #value_type' do
+ @i.value_type.should == Integer.to_type
end
end
end

0 comments on commit 893233c

Please sign in to comment.
Something went wrong with that request. Please try again.