rpl.rb/spec/words_string-list_spec.rb
2022-08-31 13:19:35 +02:00

22 lines
526 B
Ruby

# coding: utf-8
# frozen_string_literal: true
require 'minitest/autorun'
require 'rpl'
class TestLanguageStringAndList < MiniTest::Test
include Types
def test_rev
interpreter = Rpl.new
interpreter.run '"my string to sub" rev'
assert_equal [Types.new_object( RplString, '"my string to sub"'.reverse )],
interpreter.stack
interpreter = Rpl.new
interpreter.run '{ 1 2 3 } rev'
assert_equal [Types.new_object( RplList, '{ 3 2 1 }' )],
interpreter.stack
end
end