summaryrefslogtreecommitdiff
path: root/lib/iter/test/enum.myr
blob: 5c09734628cb868bfad33a3d806ed1b9606294f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use std

const main = {
	var n

	n = 0
	for (x, i) : std.byenum([1,3,5,7,9][:])
		std.assert(x == n, "invalid enum idx {}", x)
		std.assert(i == n*2 + 1, "invalid enum val {}", i)
		n++
	;;
}