summaryrefslogtreecommitdiff
path: root/tests/enums/switch.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-03-31 10:39:38 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-03-31 10:39:38 +0200
commitf9c688ad262dc6db5047981b00a9753d86b5fdf6 (patch)
treefd0703919e0146fbff251615ef96c2743156c9f9 /tests/enums/switch.vala
parent795e3217f7166acbe6d505282e6f1f9e3b8c2712 (diff)
downloadvala-f9c688ad262dc6db5047981b00a9753d86b5fdf6.tar.gz
tests: Add "switch enum" test to increase coverage
Diffstat (limited to 'tests/enums/switch.vala')
-rw-r--r--tests/enums/switch.vala18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/enums/switch.vala b/tests/enums/switch.vala
new file mode 100644
index 000000000..031881bd8
--- /dev/null
+++ b/tests/enums/switch.vala
@@ -0,0 +1,18 @@
+enum Foo {
+ BAR,
+ MANAM
+}
+
+void main () {
+ var foo = Foo.MANAM;
+
+ switch (foo) {
+ case Foo.BAR:
+ assert_not_reached ();
+ break;
+ case Foo.MANAM:
+ break;
+ default:
+ assert_not_reached ();
+ }
+}