rubyx/test/risc/builtin/test_int_cmp.rb
Torsten Ruger 1c09d4202f fix all test
and thus all green, two weeks of side branch positioning  done
(luckily not on arm, but interpreter)
2018-05-25 20:40:39 +03:00

59 lines
1.7 KiB
Ruby

require_relative "helper"
module Risc
module Builtin
class IntCmp < BuiltinTest
def test_smaller_true
run_main_return "4 < 5"
assert_equal Parfait::TrueClass , get_return.class
end
def test_smaller_false
run_main_return "6 < 5"
assert_equal Parfait::FalseClass , get_return.class
end
def test_smaller_false_same
run_main_return "5 < 5"
assert_equal Parfait::FalseClass , get_return.class
end
def test_larger_true
run_main_return "5 > 4"
assert_equal Parfait::TrueClass , get_return.class
end
def test_larger_false
run_main_return "5 > 6"
assert_equal Parfait::FalseClass , get_return.class
end
def test_larger_false_same
run_main_return "5 > 5"
assert_equal Parfait::FalseClass , get_return.class
end
def test_smaller_or_true
run_main_return "4 <= 5"
assert_equal Parfait::TrueClass , get_return.class
end
def test_smaller_or_false
run_main_return "6 <= 5"
assert_equal Parfait::FalseClass , get_return.class
end
def test_smaller_or_same
run_main_return "5 <= 5"
assert_equal Parfait::TrueClass , get_return.class
end
def test_larger_or_true
run_main_return "5 >= 4"
assert_equal Parfait::TrueClass , get_return.class
end
def test_larger_or_false
run_main_return "5 >= 6"
assert_equal Parfait::FalseClass , get_return.class
end
def test_larger_or_same
run_main_return "5 >= 5"
assert_equal Parfait::TrueClass , get_return.class
end
end
end
end