Add a test case for descriptions that contain UTF-8.
authorAndrew Ruthven <andrew@etc.gen.nz>
Sat, 7 Jul 2012 10:04:54 +0000 (22:04 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Sat, 7 Jul 2012 10:04:54 +0000 (22:04 +1200)
t/15-unicode.t [new file with mode: 0644]
t/xml/wide-character.xml [new file with mode: 0644]

diff --git a/t/15-unicode.t b/t/15-unicode.t
new file mode 100644 (file)
index 0000000..e80e9ff
--- /dev/null
@@ -0,0 +1,16 @@
+#!usr/bin/perl -w
+
+use strict;
+use Test::More tests => 3;
+use FindBin qw/$Bin/;
+
+my $xml = "$Bin/xml/wide-character.xml";
+
+# Test that the guide data warning is present.
+my $out = `$Bin/../bin/mythtv-status -d --file $xml 2>&1`;
+
+#diag($out);
+
+like($out, qr/MythTV status for localhost/, 'Header is present');
+unlike($out, qr/Wide character in print/m, 'No warning about wide characters');
+like($out, qr/measurements – with/,' Description contains wide character');
diff --git a/t/xml/wide-character.xml b/t/xml/wide-character.xml
new file mode 100644 (file)
index 0000000..2543445
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE Status>
+<Status version="0.24.20110505-1" ISODate="2012-07-06T17:12:00" protoVer="63" time="5:12 PM" date="Fri Jul 6 2012">
+ <Encoders count="1">
+  <Encoder local="1" hostname="cerberus" id="12" state="0" devlabel="[ DVB : /dev/dvb/adapter0/frontend0 ]" sleepstatus="8" connected="1"/>
+ </Encoders>
+ <Scheduled count="1">
+  <Program title="The Block NZ" subTitle="" programFlags="0" category="" fileSize="0" seriesId="150446506" hostname="cerberus" catType="" programId="T436880" repeat="0" stars="0" endTime="2012-07-11T20:30:00" startTime="2012-07-08T19:30:00" lastModified="2012-07-06T16:12:52">The couples begin their first room renovation and Mark challenges them to build a wall to his exact measurements – with a prize that will turn the competition upside down.<Channel inputId="17" chanFilters="" commFree="0" channelName="TV3" sourceId="7" chanId="8920" chanNum="3" callSign="TV3"/>
+   <Recording recPriority="1" playGroup="Default" recStatus="-1" recStartTs="2012-07-11T19:30:00" recGroup="Default" dupMethod="6" recType="10" encoderId="12" recProfile="Default" recEndTs="2012-07-11T20:30:00" recordId="795" dupInType="15"/>
+  </Program>
+ </Scheduled>
+ <JobQueue count="0"/>
+ <MachineInfo>
+  <Storage>
+   <Group dir="TotalDiskSpace" id="total" free="17083" deleted="0" total="102350" used="85266" expirable="61679" livetv="0"/>
+   <Group dir="cerberus:/home/videos/mythtv/recordings" id="1" free="17083" total="102350" used="85266"/>
+  </Storage>
+  <Load avg1="0.46" avg2="0.26" avg3="0.2"/>
+  <Guide guideThru="2012-07-12T23:45:00" status="FAILED: XMLTV returned error code 512." next="1970-01-01T00:00:00" end="2012-07-06 16:12:43" guideDays="6" start="2012-07-06 16:12:42"></Guide>
+ </MachineInfo>
+</Status>
+