implement byte access for some word

wouldn’t have been possible without the ruby version
This commit is contained in:
Torsten Ruger
2015-11-11 20:36:07 +02:00
parent 9bfc9cf6c2
commit 1e7935bf85
3 changed files with 58 additions and 12 deletions

View File

@ -23,19 +23,20 @@ HERE
def test_add_doesnt_change1
@string_input = <<HERE
Word w = " "
w.push_char(32)
w.push_char(48)
return w.char_at(1)
HERE
check_return 32
check_return 32
end
def test_after_add_get_works
@string_input = <<HERE
Word w = " "
w.push_char(32)
w.push_char(48)
return w.char_at(2)
HERE
check_return 32
check_return 48
end
def test_after_add_length_works
@string_input = <<HERE
Word w = " "
@ -44,4 +45,20 @@ return w.char_length
HERE
check_return 2
end
def test_get1
@string_input = <<HERE
Word w = "12345"
return w.char_at(1)
HERE
check_return 49
end
def test_get2
@string_input = <<HERE
Word w = "12345"
return w.char_at(2)
HERE
check_return 50
end
end