From: Rico Tzschichholz Date: Sun, 7 Jan 2018 13:22:20 +0000 (+0100) Subject: tests: Add "do-while" parser tests to increase coverage X-Git-Tag: 0.39.4~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=993b9ccb5630ccd04bee063c6b4913693ae57915;p=thirdparty%2Fvala.git tests: Add "do-while" parser tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index cf7103a00..196a61ba3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -321,6 +321,7 @@ TESTS = \ annotations/deprecated.vala \ annotations/description.vala \ annotations/noaccessormethod.test \ + parser/do-statement.vala \ parser/switch-statement.vala \ parser/template.vala \ parser/tuple.vala \ diff --git a/tests/parser/do-statement.vala b/tests/parser/do-statement.vala new file mode 100644 index 000000000..f2fe99218 --- /dev/null +++ b/tests/parser/do-statement.vala @@ -0,0 +1,14 @@ +void main () { + int i = 0; + + do { + i++; + } while (i < 2); + assert (i == 2); + + do { + i = 42; + break; + } while (true); + assert (i == 42); +}