[gnumeric] Tests: test the sylk exporter



commit de8aa33d3cc292344a847103350b3b35cd17d22a
Author: Morten Welinder <terra gnome org>
Date:   Sun Dec 3 16:52:51 2017 -0500

    Tests: test the sylk exporter

 test/GnumericTest.pm |    8 ++++----
 test/Makefile.am     |    1 +
 test/t6900-sylk.pl   |    9 +++++++++
 3 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/test/GnumericTest.pm b/test/GnumericTest.pm
index 69a38b6..e29bc53 100644
--- a/test/GnumericTest.pm
+++ b/test/GnumericTest.pm
@@ -454,13 +454,13 @@ sub test_importer {
 # -----------------------------------------------------------------------------
 
 sub test_exporter {
-    my ($file) = @_;
+    my ($file,$ext) = @_;
 
     &report_skip ("file $file does not exist") unless -r $file;
 
     my $tmp = fileparse ($file);
     $tmp =~ s/\.([a-zA-Z0-9]+)$// or die "Must have extension for export test.";
-    my $ext = $1;
+    $ext = $1 unless defined $ext;
     my $code;
     my $keep = 0;
 
@@ -493,12 +493,12 @@ sub test_exporter {
 
     my $tmp4 = "$tmp.xml";
     &junkfile ($tmp4) unless $keep;
-    $code = system (&quotearg ("zcat", "-f", $tmp1) . " >" . &quotearg ($tmp4));
+    $code = system (&quotearg ("zcat", "-f", $tmp1) . "| $normalize_gnumeric >" . &quotearg ($tmp4));
     &system_failure ('zcat', $code) if $code;
 
     my $tmp5 = "$tmp-new.xml";
     &junkfile ($tmp5) unless $keep;
-    $code = system (&quotearg ("zcat" , "-f", $tmp3) . " >" . &quotearg ($tmp5));
+    $code = system (&quotearg ("zcat" , "-f", $tmp3) . " | $normalize_gnumeric >" . &quotearg ($tmp5));
     &system_failure ('zcat', $code) if $code;
 
     $code = system ('diff', '-u', $tmp4, $tmp5);
diff --git a/test/Makefile.am b/test/Makefile.am
index 52942ed..b1f4b83 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -115,6 +115,7 @@ TESTS =     t1000-statfuns.pl                       \
        t6521-sheet-names.pl                    \
        t6522-hlink.pl                          \
        t6590-samples.pl                        \
+       t6900-sylk.pl                           \
        t7000-goal-seek.pl                      \
        t7100-solver-blend.pl                   \
        t7101-solver-afiro.pl                   \
diff --git a/test/t6900-sylk.pl b/test/t6900-sylk.pl
new file mode 100755
index 0000000..d9fe24a
--- /dev/null
+++ b/test/t6900-sylk.pl
@@ -0,0 +1,9 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use GnumericTest;
+
+&message ("Check the sylk exporter.");
+&test_exporter ("$samples/sylk/app_b2.sylk", "slk");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]