mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 10:20:05 +00:00
bytes: fix last_index_byte off-by-one
This commit is contained in:
@@ -87,3 +87,11 @@ test_index_byte_zero :: proc(t: ^testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@test
|
||||
test_last_index_byte_bounds :: proc(t: ^testing.T) {
|
||||
input := "helloworld.odin."
|
||||
assert(len(input) == 16)
|
||||
idx := bytes.last_index_byte(transmute([]byte)(input[:len(input)-1]), '.')
|
||||
testing.expect_value(t, idx, 10)
|
||||
}
|
||||
Reference in New Issue
Block a user