diff options
Diffstat (limited to 't/13-plural.t')
-rw-r--r-- | t/13-plural.t | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/t/13-plural.t b/t/13-plural.t new file mode 100644 index 0000000..9ecce29 --- /dev/null +++ b/t/13-plural.t @@ -0,0 +1,49 @@ +#! /usr/bin/perl +# MAN module tester. + +######################### + +use strict; +use warnings; + +use lib q(t); +use Testhelper; + +my @tests; + +my $diff_pod_flags = " -I 'This file was generated by po4a' "; + +push @tests, + { + 'run' => "PATH/po4a-translate -f pod -k 0 -m t-13-plural/pod1 -p t-13-plural/pod1.po -l tmp/pod1.fr 2> tmp/err", + 'tests' => ["diff -u t-13-plural/pod1.fr tmp/pod1.fr $diff_pod_flags"], + 'doc' => "Parse plural forms", + }, + { + 'run' => "PATH/po4a-translate -f pod -k 0 -m t-13-plural/pod2 -p t-13-plural/pod1.po -l tmp/pod2.fr 2> tmp/err", + 'tests' => ["diff -u t-13-plural/pod2.fr tmp/pod2.fr $diff_pod_flags"], + 'doc' => "Use singular form", + }, + { + 'run' => "PATH/po4a-translate -f pod -k 0 -m t-13-plural/pod3 -p t-13-plural/pod1.po -l tmp/pod3.fr 2> tmp/err", + 'tests' => ["diff -u t-13-plural/pod3.fr tmp/pod3.fr $diff_pod_flags"], + 'doc' => "Use plural form", + }, + { + 'run' => "PATH/po4a-translate -f pod -k 0 -m t-13-plural/pod4 -p t-13-plural/pod1.po -l tmp/pod4.fr 2> tmp/err", + 'tests' => ["diff -u t-13-plural/pod4.fr tmp/pod4.fr $diff_pod_flags"], + 'doc' => "Use single and plural form", + }, + { + 'run' => "PATH/po4a-translate -f pod -k 0 -m t-13-plural/pod4 -p t-13-plural/pod1.po -l tmp/pod4.fr 2> tmp/err", + 'tests' => ["diff -u t-13-plural/err1 tmp/err $diff_pod_flags"], + 'doc' => "Warn when using plural forms", + }, + { + 'run' => "PATH/po4a-translate -f pod -k 0 -m t-13-plural/pod4 -p t-13-plural/pod2.po -l tmp/pod4.fr 2> tmp/err", + 'tests' => ["diff -u t-13-plural/pod4.fr tmp/pod4.fr $diff_pod_flags"], + 'doc' => "Use single and plural form with multiple plural translations", + }; + +run_all_tests(@tests); +0; |