]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add basic GLib.Node test
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 20 Mar 2018 09:24:42 +0000 (10:24 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 26 Mar 2018 09:07:29 +0000 (11:07 +0200)
tests/basic-types/glists.vala

index c5ee1b9a4e07657521beaa660f893a61900315df..0d25e448184aaa3d139d86f8e5d9d95f3aa12cf7 100644 (file)
@@ -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 ();
 }