]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "contains" method test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 7 Jan 2018 12:13:54 +0000 (13:13 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Jan 2018 19:44:55 +0000 (20:44 +0100)
tests/Makefile.am
tests/methods/contains.vala [new file with mode: 0644]

index b77718de870bb919b8df5df95b17922bd3ec1b51..a8c3e735e68880e60938ec4544312a66aecb8fec 100644 (file)
@@ -64,6 +64,7 @@ TESTS = \
        namespaces.vala \
        methods/lambda.vala \
        methods/closures.vala \
+       methods/contains.vala \
        methods/prepostconditions.vala \
        methods/symbolresolution.vala \
        methods/bug595538.vala \
diff --git a/tests/methods/contains.vala b/tests/methods/contains.vala
new file mode 100644 (file)
index 0000000..1f143d4
--- /dev/null
@@ -0,0 +1,10 @@
+class Foo {
+       public bool contains (int item) {
+               return item == 42;
+       }
+}
+
+void main () {
+       var foo = new Foo ();
+       assert (42 in foo);
+}