[gxml] Added test to read GomDate
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Added test to read GomDate
- Date: Fri, 10 Feb 2017 20:46:44 +0000 (UTC)
commit f494bbcb400b60bb2bd09258d00a75204855fd76
Author: Daniel Espinosa <esodan gmail com>
Date: Fri Feb 10 13:34:11 2017 -0600
Added test to read GomDate
test/GomSerializationTest.vala | 28 +++++++++++++++++++++++++---
1 files changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/test/GomSerializationTest.vala b/test/GomSerializationTest.vala
index 6d5127d..9e88106 100644
--- a/test/GomSerializationTest.vala
+++ b/test/GomSerializationTest.vala
@@ -426,9 +426,9 @@ class GomSerializationTest : GXmlTest {
var t = new Taxes ();
string s = t.to_string ();
assert (s != null);
-//#if DEBUG
+#if DEBUG
GLib.message ("DOC:"+s);
-//#endif
+#endif
assert ("<Taxes " in s);
assert ("monthRate=\"0\"" in s);
assert ("Month=\"january\"" in s);
@@ -437,9 +437,9 @@ class GomSerializationTest : GXmlTest {
var d = Date ();
d.set_dmy ((DateDay) 1, (DateMonth) 2, (DateYear) 2017);
assert (d.valid ());
+ assert (t.pay_date != null);
t.pay_date.set_date (d);
assert (t.pay_date.get_date ().valid ());
- assert (t.pay_date != null);
assert (t.pay_date.value != null);
assert (t.pay_date.value == "2017-02-01");
t.pay_date.value = "2023-3-10";
@@ -457,6 +457,28 @@ class GomSerializationTest : GXmlTest {
assert_not_reached ();
}
});
+ Test.add_func ("/gxml/gom-serialization/read/property-date", () => {
+ try {
+ var t = new Taxes ();
+ t.read_from_string ("<Taxes PayDate=\"2050-12-09\"/>");
+ string s = t.to_string ();
+ assert (s != null);
+//#if DEBUG
+ GLib.message ("DOC:"+s);
+//#endif
+ assert ("<Taxes " in s);
+ assert ("monthRate=\"0\"" in s);
+ assert ("Month=\"january\"" in s);
+ assert ("TaxFree=\"false\"" in s);
+ assert (t.pay_date != null);
+ assert (t.pay_date.get_date ().valid ());
+ assert (t.pay_date.value != null);
+ assert (t.pay_date.value == "2050-12-09");
+ } catch (GLib.Error e) {
+ GLib.message ("Error: "+e.message);
+ assert_not_reached ();
+ }
+ });
Test.add_func ("/gxml/gom-serialization/write/property-arraylist", () => {
try {
var bs = new BookStand ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]