diff --git a/lib/register/interpreter.rb b/lib/register/interpreter.rb index 45861eae..29b49bcf 100644 --- a/lib/register/interpreter.rb +++ b/lib/register/interpreter.rb @@ -170,7 +170,7 @@ module Register if object.is_a?(Symbol) raise "Unsupported action, must convert symbol to word:#{object}" else - value = object.get_internal_byte( index ) + value = object.get_char( index ) end #value = value.object_id unless value.is_a? Fixnum set_register( @instruction.register , value ) diff --git a/test/register/interpreter/test_all.rb b/test/register/interpreter/test_all.rb index 761b562d..23263e50 100644 --- a/test/register/interpreter/test_all.rb +++ b/test/register/interpreter/test_all.rb @@ -4,3 +4,4 @@ require_relative "test_if" require_relative "test_puts" require_relative "test_plus" require_relative "test_mult" +require_relative "test_word" diff --git a/test/register/interpreter/test_word.rb b/test/register/interpreter/test_word.rb new file mode 100644 index 00000000..9384352f --- /dev/null +++ b/test/register/interpreter/test_word.rb @@ -0,0 +1,66 @@ +require_relative "helper" + +class TestWord < MiniTest::Test + include Ticker + + def setup + @string_input = <