aboutsummaryrefslogtreecommitdiff
path: root/tests/issues/test_issue_2615.odin
blob: 229e5c35bdcb46ed34b8fc4662d148478d32f2b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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, '世')
		}
	}
}