rubyx/test/compiler/test_basic.rb
2015-10-10 10:02:28 +03:00

48 lines
682 B
Ruby

require_relative "compiler_helper"
class TestBasic < MiniTest::Test
include CompilerHelper
def setup
@root = :basic_type
@output = [Virtual::Return]
end
def test_number
@string_input = '42 '
check
end
def test_true
@string_input = 'true '
check
end
def test_false
@string_input = 'false '
check
end
def test_nil
@string_input = 'nil '
check
end
def test_var
@string_input = 'int foo '
@root = :field_def
check
end
def test_self
@string_input = 'self '
@output = [Virtual::Self]
check
end
def test_string
@string_input = "\"hello\""
check
end
end