[vala/wip/issue/327: 22/27] Cleaned up a little
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/issue/327: 22/27] Cleaned up a little
- Date: Thu, 23 Apr 2020 17:39:44 +0000 (UTC)
commit fa7422596dde9b62e5831d7c25a5b27a94a03fb6
Author: Nick Schrader <nick schrader mailbox org>
Date: Mon Apr 6 22:06:29 2020 -0300
Cleaned up a little
tests/objects/with-instance.vala | 14 ++++++++++----
tests/semantic/with-no-such-member.test | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/tests/objects/with-instance.vala b/tests/objects/with-instance.vala
index d8b285089..e2081c719 100644
--- a/tests/objects/with-instance.vala
+++ b/tests/objects/with-instance.vala
@@ -1,5 +1,5 @@
class Foo {
- public int field;
+ public int field;
public string prop { get; set; }
public bool method_called = false;
@@ -11,7 +11,8 @@ class Foo {
class Bar : Foo { }
class TestFoo {
- public int class_field;
+ public static int class_field;
+ public int instance_field;
public void test () {
var foo = new Foo ();
@@ -24,6 +25,7 @@ class TestFoo {
local_field = 20;
class_field = 30;
+ instance_field = 40;
}
assert (foo.field == 10);
@@ -32,12 +34,14 @@ class TestFoo {
assert (local_field == 20);
assert (class_field == 30);
+ assert (instance_field == 40);
}
}
// Copy and paste TestFoo, change Foo to Bar
-class TestBar {
- public int class_field;
+class TestFoo {
+ public static int class_field;
+ public int instance_field;
public void test () {
var foo = new Bar ();
@@ -50,6 +54,7 @@ class TestBar {
local_field = 20;
class_field = 30;
+ instance_field = 40;
}
assert (foo.field == 10);
@@ -58,6 +63,7 @@ class TestBar {
assert (local_field == 20);
assert (class_field == 30);
+ assert (instance_field == 40);
}
}
diff --git a/tests/semantic/with-no-such-member.test b/tests/semantic/with-no-such-member.test
index 76807d501..5bf81cd4b 100644
--- a/tests/semantic/with-no-such-member.test
+++ b/tests/semantic/with-no-such-member.test
@@ -3,7 +3,7 @@ Invalid Code
class Foo { }
void main () {
- with (new Foo()) {
+ with (new Foo ()) {
field = 100;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]