v2 / vlib / v / tests / aliases / alias_string_match_test.v
15 lines · 12 sloc · 360 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1type ReleaseTarget = string
2
3const production = ReleaseTarget('production')
4const testing = ReleaseTarget('testing')
5
6fn test_alias_string_match() {
7 target := match ReleaseTarget('testing') {
8 production { production }
9 testing { testing }
10 else { panic(error('Invalid target')) }
11 }
12
13 assert target == ReleaseTarget('testing')
14 assert target == testing
15}
16