implement byte access for some word
wouldn’t have been possible without the ruby version
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user