2015-05-15 19:59:02 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2017-09-27 14:35:55 +02:00
|
|
|
class BasicRxFile < MiniTest::Test
|
2015-05-15 19:59:33 +02:00
|
|
|
include Checker
|
|
|
|
|
2015-05-15 19:59:02 +02:00
|
|
|
def test_true
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = true
|
2015-05-15 19:59:33 +02:00
|
|
|
check "true"
|
|
|
|
end
|
|
|
|
def test_string
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = "true"
|
2015-05-15 19:59:33 +02:00
|
|
|
check "'true'"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_num
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = 124
|
2015-05-15 19:59:33 +02:00
|
|
|
check "124"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_simple_array
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = [true, 1234]
|
2015-05-15 19:59:33 +02:00
|
|
|
check "[true, 1234]"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_array_array
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = [true, 1 , [true , 12 ]]
|
2015-06-17 20:16:39 +02:00
|
|
|
check "[true, 1, [true, 12]]"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_array_array_reverse
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = [ [true , 12 ], true, 1]
|
2015-06-17 20:16:39 +02:00
|
|
|
check "[[true, 12], true, 1]"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_array_array_array
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = [true, 1 , [true , 12 , [true , 123 ]]]
|
2015-06-17 20:16:39 +02:00
|
|
|
check "[true, 1, [true, 12, [true, 123]]]"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_simple_hash
|
2015-06-16 17:12:15 +02:00
|
|
|
@out = { :one => 1 , :tru => true }
|
2015-05-15 19:59:33 +02:00
|
|
|
check "{:one => 1, :tru => true}"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_array_hash
|
2015-06-16 17:12:15 +02:00
|
|
|
@out = [true, 1 , { :one => 1 , :tru => true }]
|
2015-06-17 20:16:39 +02:00
|
|
|
check "[true, 1, {:one => 1, :tru => true}]"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
|
|
|
def test_array_recursive
|
|
|
|
ar = [true, 1 ]
|
|
|
|
ar << ar
|
2015-05-15 20:03:11 +02:00
|
|
|
@out = ar
|
2015-06-16 17:12:15 +02:00
|
|
|
check "&1 [true, 1, ->1]"
|
2015-05-15 19:59:02 +02:00
|
|
|
end
|
2015-05-15 19:59:33 +02:00
|
|
|
end
|