[vala/0.48] tests: Extend "generics reference transfer" test to increase coverage



commit f5a15009b40030ef50188a81c5450ca8efc3a044
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri May 7 13:46:28 2021 +0200

    tests: Extend "generics reference transfer" test to increase coverage

 tests/generics/reference-transfer.vala | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/tests/generics/reference-transfer.vala b/tests/generics/reference-transfer.vala
index da2c1e305..5dc7a666f 100644
--- a/tests/generics/reference-transfer.vala
+++ b/tests/generics/reference-transfer.vala
@@ -19,6 +19,16 @@ void foo<G> (owned G g) {
 }
 
 void main () {
-       foo<string> ("foo");
-       bar<string> (new Bar<string> ("bar"));
+       {
+               foo<string> ("foo");
+       }
+       {
+               bar<string> (new Bar<string> ("bar"));
+       }
+       {
+               var bar = new Bar<string> ("bar");
+               var t = (owned) bar.g;
+               assert (bar.g == null);
+               assert (t == "bar");
+       }
 }


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