[vala/staging: 1/2] tests: Add basic GLib.Node test
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 1/2] tests: Add basic GLib.Node test
- Date: Tue, 20 Mar 2018 12:39:09 +0000 (UTC)
commit efc88b43f598248b0a1d1871ab8cf041fb1789a3
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Mar 20 10:24:42 2018 +0100
tests: Add basic GLib.Node test
tests/basic-types/glists.vala | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/tests/basic-types/glists.vala b/tests/basic-types/glists.vala
index c5ee1b9..0d25e44 100644
--- a/tests/basic-types/glists.vala
+++ b/tests/basic-types/glists.vala
@@ -40,8 +40,23 @@ void test_gqueue () {
queue2 = null;
}
+void test_gnode () {
+ var nodes = new GLib.Node<string> ();
+ nodes.append_data ("foo");
+ nodes.append_data ("bar");
+ assert (nodes.nth_child (1).data == "bar");
+ nodes = null;
+
+ var nodes2 = new GLib.Node<unowned string> ();
+ nodes2.append_data ("foo");
+ nodes2.append_data ("bar");
+ assert (nodes2.nth_child (1).data == "bar");
+ nodes2 = null;
+}
+
void main () {
test_glist ();
test_gslist ();
test_gqueue ();
+ test_gnode ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]