mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 01:44:36 +00:00
20 lines
399 B
Odin
20 lines
399 B
Odin
// Tests issue https://github.com/odin-lang/Odin/issues/2615
|
|
// Cannot iterate over string literals
|
|
package test_issues
|
|
|
|
import "core:testing"
|
|
|
|
@(test)
|
|
test_cannot_iterate_over_string_literal :: proc(t: ^testing.T) {
|
|
for c, i in "fo世" {
|
|
switch i {
|
|
case 0:
|
|
testing.expect_value(t, c, 'f')
|
|
case 1:
|
|
testing.expect_value(t, c, 'o')
|
|
case 2:
|
|
testing.expect_value(t, c, '世')
|
|
}
|
|
}
|
|
}
|