This commit is contained in:
Laytan Laats
2023-07-02 23:00:37 +02:00
parent fc81008ab5
commit a3e2d90f4c
3 changed files with 21 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// 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, '世')
}
}
}