2019-08-12 23:13:29 +02:00
|
|
|
require_relative "../helper"
|
2018-04-19 18:59:48 +02:00
|
|
|
|
2019-08-12 23:13:29 +02:00
|
|
|
module Risc
|
2019-09-11 19:17:43 +02:00
|
|
|
module Macro
|
2019-08-12 23:13:29 +02:00
|
|
|
class IntCmp < Minitest::Test
|
2019-08-12 11:36:32 +02:00
|
|
|
include Ticker
|
|
|
|
def setup
|
2019-09-13 13:07:12 +02:00
|
|
|
@preload = [:le,:ge,:gt,:lt].collect{|op| "Integer.#{op}"}.join(";")
|
2019-08-12 11:36:32 +02:00
|
|
|
end
|
2018-04-19 18:59:48 +02:00
|
|
|
|
2018-04-19 21:57:31 +02:00
|
|
|
def test_smaller_true
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "4 < 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::TrueClass , get_message_return.class
|
2018-04-19 21:13:52 +02:00
|
|
|
end
|
2018-04-19 21:57:31 +02:00
|
|
|
def test_smaller_false
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "6 < 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::FalseClass , get_message_return.class
|
2018-04-19 21:57:31 +02:00
|
|
|
end
|
2018-04-23 18:39:16 +02:00
|
|
|
def test_smaller_false_same
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 < 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::FalseClass , get_message_return.class
|
2018-04-23 18:39:16 +02:00
|
|
|
end
|
2018-04-19 21:57:31 +02:00
|
|
|
def test_larger_true
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 > 4"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::TrueClass , get_message_return.class
|
2018-04-19 21:57:31 +02:00
|
|
|
end
|
|
|
|
def test_larger_false
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 > 6"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::FalseClass , get_message_return.class
|
2018-04-19 21:57:31 +02:00
|
|
|
end
|
2018-04-23 18:39:16 +02:00
|
|
|
def test_larger_false_same
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 > 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::FalseClass , get_message_return.class
|
2018-04-23 18:39:16 +02:00
|
|
|
end
|
2018-04-24 18:45:58 +02:00
|
|
|
|
|
|
|
def test_smaller_or_true
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "4 <= 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::TrueClass , get_message_return.class
|
2018-04-24 18:45:58 +02:00
|
|
|
end
|
|
|
|
def test_smaller_or_false
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "6 <= 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::FalseClass , get_message_return.class
|
2018-04-24 18:45:58 +02:00
|
|
|
end
|
|
|
|
def test_smaller_or_same
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 <= 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::TrueClass , get_message_return.class
|
2018-04-24 18:45:58 +02:00
|
|
|
end
|
|
|
|
def test_larger_or_true
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 >= 4"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::TrueClass , get_message_return.class
|
2018-04-24 18:45:58 +02:00
|
|
|
end
|
|
|
|
def test_larger_or_false
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 >= 6"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::FalseClass , get_message_return.class
|
2018-04-24 18:45:58 +02:00
|
|
|
end
|
|
|
|
def test_larger_or_same
|
2018-05-25 19:40:39 +02:00
|
|
|
run_main_return "5 >= 5"
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal Parfait::TrueClass , get_message_return.class
|
2018-04-24 18:45:58 +02:00
|
|
|
end
|
2018-04-19 18:59:48 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|