[gxml] Added TwComment Unit tests
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Added TwComment Unit tests
- Date: Wed, 13 May 2015 20:50:17 +0000 (UTC)
commit 422ddd8041dc3f53274c13c592145b77b83042a5
Author: Daniel Espinosa <esodan gmail com>
Date: Tue May 12 15:05:07 2015 -0500
Added TwComment Unit tests
test/Makefile.am | 1 +
test/TwCommentTest.vala | 50 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/test/Makefile.am b/test/Makefile.am
index dc169d5..ba2be4c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -52,6 +52,7 @@ sources = \
TwElementTest.vala \
TwDocumentTest.vala \
TwCDATATest.vala \
+ TwCommentTest.vala \
$(NULL)
gxml_test.vala.stamp: $(sources)
diff --git a/test/TwCommentTest.vala b/test/TwCommentTest.vala
new file mode 100644
index 0000000..4854882
--- /dev/null
+++ b/test/TwCommentTest.vala
@@ -0,0 +1,50 @@
+/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
+/* TwCDATATest.vala
+ *
+ * Copyright (C) 2011-2015 Daniel Espinosa <esodan gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Daniel Espinosa <esodan gmail com>
+ */
+
+using GXml;
+
+class TwComentTest : GXmlTest {
+ public static void add_tests () {
+ Test.add_func ("/gxml/tw-comment", () => {
+ try {
+ var d = new TwDocument ();
+ var r = d.create_element ("root");
+ d.childs.add (r);
+ var cd = d.create_comment ("This is a comment");
+ assert (cd.value == "This is a comment");
+ d.root.childs.add (cd);
+ assert (d.root.childs.size == 1);
+ string str = d.to_string ();
+ assert ("<root><!This is a comment></root>" in str);
+#if DEBUG
+ GLib.message (@"$d");
+#endif
+ }
+ catch (GLib.Error e) {
+#if DEBUG
+ GLib.message (@"ERROR: $(e.message)");
+#endif
+ assert_not_reached ();
+ }
+ });
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]