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

const main = {
	var n

	n = 0
	for (x, i) : iter.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++
	;;
}