[vala/0.38] tests: Add "contains" method test to increase coverage



commit 5a86471f76b1de518acb2d387d52a83ac2f6ebfc
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Jan 7 13:13:54 2018 +0100

    tests: Add "contains" method test to increase coverage

 tests/Makefile.am           |    1 +
 tests/methods/contains.vala |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b77718d..a8c3e73 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
index 0000000..1f143d4
--- /dev/null
+++ b/tests/methods/contains.vala
@@ -0,0 +1,10 @@
+class Foo {
+       public bool contains (int item) {
+               return item == 42;
+       }
+}
+
+void main () {
+       var foo = new Foo ();
+       assert (42 in foo);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]