[vala/staging: 4/6] tests: Clean up control-flow/sideeffects
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 4/6] tests: Clean up control-flow/sideeffects
- Date: Sun, 19 Nov 2017 13:17:13 +0000 (UTC)
commit 3aeb354874c4c89bff290fd96f8f3c767e692a49
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Nov 19 14:03:31 2017 +0100
tests: Clean up control-flow/sideeffects
tests/control-flow/sideeffects.vala | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/tests/control-flow/sideeffects.vala b/tests/control-flow/sideeffects.vala
index 56028a5..b385356 100644
--- a/tests/control-flow/sideeffects.vala
+++ b/tests/control-flow/sideeffects.vala
@@ -1,22 +1,16 @@
-class Maman.Foo : Object {
+class Foo : Object {
public int i = 1;
- public weak Foo sideeffect () {
+ public unowned Foo sideeffect () {
--i;
return this;
}
public string data;
}
-class Maman.Bar : Object {
- public static int main () {
- var foo = new Foo ();
- foo.sideeffect ().data = "foo";
- assert (foo.i == 0);
- return 0;
- }
-}
-
void main () {
- Maman.Bar.main ();
+ var foo = new Foo ();
+ foo.sideeffect ().data = "foo";
+ assert (foo.data == "foo");
+ assert (foo.i == 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]