[vala/0.36: 135/212] tests: Add "contains" method test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36: 135/212] tests: Add "contains" method test to increase coverage
- Date: Sat, 14 Apr 2018 07:54:42 +0000 (UTC)
commit ea5e4a4a96bcad173b40255f5983ec5ca9fde771
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 eb4fdf9..86e8333 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -63,6 +63,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]