Commit e864a711 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Fixed test as XML prolog is not written automatically.

parent 6d3c4c87
Pipeline #1069 passed with stage
in 26 minutes and 9 seconds
......@@ -53,7 +53,8 @@ public class XmlGeneratorTest {
generator.writeEntry("KEY_2", 1234567.8, Unit.parse("n/a"), false);
generator.writeEntry("KEY_3", 1234567.8, Unit.parse("1"), false);
generator.writeEntry("LOOOOONG", "1234567.8", null, false);
Assert.assertEquals("<KEY_1 units=\"km*kg**3/s**0.5\">1234.5678</KEY_1>\n" +
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<KEY_1 units=\"km*kg**3/s**0.5\">1234.5678</KEY_1>\n" +
"<KEY_2>1234567.8</KEY_2>\n" +
"<KEY_3>1234567.8</KEY_3>\n" +
"<LOOOOONG>1234567.8</LOOOOONG>\n",
......@@ -68,7 +69,8 @@ public class XmlGeneratorTest {
generator.writeEntry("KEY_1", 0.5 * FastMath.PI, Unit.parse("°"), false);
generator.writeEntry("KEY_2", FastMath.PI, Unit.parse("◦"), false);
generator.writeEntry("PERCENT", 0.25, Unit.parse("%"), false);
Assert.assertEquals("<KEY_1 units=\"deg\">90.0</KEY_1>\n" +
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<KEY_1 units=\"deg\">90.0</KEY_1>\n" +
"<KEY_2 units=\"deg\">180.0</KEY_2>\n" +
"<PERCENT units=\"%\">25.0</PERCENT>\n",
caw.toString());
......@@ -81,7 +83,8 @@ public class XmlGeneratorTest {
try (Generator generator = new XmlGenerator(caw, 2, "", false)) {
generator.writeEntry("KEY_1", 0.5 * FastMath.PI, Unit.parse("°"), false);
generator.writeEntry("KEY_2", FastMath.PI, Unit.parse("◦"), true);
Assert.assertEquals("<KEY_1>90.0</KEY_1>\n" +
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<KEY_1>90.0</KEY_1>\n" +
"<KEY_2>180.0</KEY_2>\n",
caw.toString());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment