rubyx/test/fragments/test_if.rb

26 lines
558 B
Ruby
Raw Normal View History

2014-05-24 10:18:54 +03:00
require_relative 'helper'
class TestIf < MiniTest::Test
include Fragments
def test_if
@string_input = <<HERE
def itest(n)
2014-05-24 10:18:54 +03:00
if( n < 12)
2014-06-08 00:56:40 +03:00
"then".putstring()
2014-05-24 10:18:54 +03:00
else
2014-06-08 00:56:40 +03:00
"else".putstring()
2014-05-24 10:18:54 +03:00
end
end
itest(20)
2014-05-24 10:18:54 +03:00
HERE
2014-06-12 09:07:03 +03:00
@should = [0x0,0x40,0x2d,0xe9,0xc,0x0,0x53,0xe3,0x3,0x0,0x0,0xba,0x44,0x20,0x8f,0xe2,0x8,0x30,0xa0,0xe3,0x4,0x0,0x0,0xeb,0x2,0x0,0x0,0xea,0x3c,0x20,0x8f,0xe2,0x8,0x30,0xa0,0xe3,0x0,0x0,0x0,0xeb,0x0,0x80,0xbd,0xe8]
@output = "else "
@target = [:Object , :itest]
2014-05-24 10:18:54 +03:00
parse
write "if"
end
end