]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "assignment" operator parser tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 7 Jan 2018 14:27:57 +0000 (15:27 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 7 Jan 2018 19:26:03 +0000 (20:26 +0100)
tests/Makefile.am
tests/parser/assignment.vala [new file with mode: 0644]

index 196a61ba3188c5ca67b6c1724e8cfdb2afbb5c81..4e75436d2aa00bf690a4d05e558956956e5203e6 100644 (file)
@@ -321,6 +321,7 @@ TESTS = \
        annotations/deprecated.vala \
        annotations/description.vala \
        annotations/noaccessormethod.test \
+       parser/assignment.vala \
        parser/do-statement.vala \
        parser/switch-statement.vala \
        parser/template.vala \
diff --git a/tests/parser/assignment.vala b/tests/parser/assignment.vala
new file mode 100644 (file)
index 0000000..ceef7cf
--- /dev/null
@@ -0,0 +1,14 @@
+void main () {
+       // operators
+       int i = 1;
+       i += 2;
+       i -= 2;
+       i *= 2;
+       i /= 2;
+       i |= 1;
+       i &= 1; 
+       i ^= 1;
+       i %= 1;
+       i <<= 2;
+       i >>= 2;
+}