summaryrefslogtreecommitdiffstats
path: root/t/cfg-args.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 11:26:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 11:26:17 +0000
commit5df6c2aefebe3d2abcc939a88e294876d59f03ca (patch)
tree63fb332a0f21ddb91cb789c80cf64e134d373463 /t/cfg-args.t
parentInitial commit. (diff)
downloadpo4a-5df6c2aefebe3d2abcc939a88e294876d59f03ca.tar.xz
po4a-5df6c2aefebe3d2abcc939a88e294876d59f03ca.zip
Adding upstream version 0.72.upstream/0.72
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/cfg-args.t')
-rw-r--r--t/cfg-args.t87
1 files changed, 87 insertions, 0 deletions
diff --git a/t/cfg-args.t b/t/cfg-args.t
new file mode 100644
index 0000000..aad779d
--- /dev/null
+++ b/t/cfg-args.t
@@ -0,0 +1,87 @@
+#! /usr/bin/perl
+# config file tester.
+
+#########################
+
+use strict;
+use warnings;
+
+use lib q(t);
+use Testhelper;
+
+# TODO: alias option overriding generic option
+# TODO: file-specific overriding alias option
+
+my @tests;
+push @tests, {
+ 'doc' => '-k 20 in global options',
+ 'po4a.conf' => 'cfg/args-global/po4a.conf',
+ 'modes' => 'dstdir', # no need to test every mode
+ 'options' => '--no-update', # no need for the produced po files
+ 'expected_files' => 'man.de.1 man.es.1 man.fr.1 man.it.1'
+
+ },
+ {
+ 'doc' => '-k 100 on command line >> -k 20 in global options',
+ 'po4a.conf' => 'cfg/args-global/po4a.conf',
+ 'modes' => 'dstdir',
+ 'options' => '--no-update --keep 100',
+ 'expected_outfile' => '_output-keep100',
+ 'expected_files' => 'man.it.1'
+
+ },
+ {
+ 'doc' => '-k 0 in type alias',
+ 'po4a.conf' => 'cfg/args-alias/po4a.conf',
+ 'modes' => 'dstdir',
+ 'options' => '--no-update',
+ 'expected_files' => 'man.de.1 man.fr.1 man.fr.2 man.it.1 man.it.2'
+ },
+ {
+ 'doc' => '-k 100 on command line >> -k 0 in type alias',
+ 'po4a.conf' => 'cfg/args-alias/po4a.conf',
+ 'modes' => 'dstdir',
+ 'options' => '--no-update --keep 100',
+ 'expected_outfile' => '_output-keep100',
+ 'expected_files' => 'man.it.1 man.it.2'
+
+ },
+ {
+ 'doc' => '-k 0 in type alias, but with a redefinition of the same alias',
+ 'po4a.conf' => 'cfg/args-alias-redef/po4a.conf',
+ 'modes' => 'dstdir',
+ 'options' => '--no-update',
+ 'expected_files' => 'man.de.1 man.fr.1 man.it.1'
+ },
+ {
+ 'doc' => '-k 40 in master doc',
+ 'po4a.conf' => 'cfg/args-master/po4a.conf',
+ 'modes' => 'dstdir',
+ 'options' => '--no-update',
+ 'expected_files' => 'man.fr.1 man.it.1'
+ },
+ {
+ 'doc' => '-k 100 on command line >> -k 40 in master doc',
+ 'po4a.conf' => 'cfg/args-master/po4a.conf',
+ 'modes' => 'dstdir',
+ 'options' => '--no-update --keep 100',
+ 'expected_outfile' => '_output-keep100',
+ 'expected_files' => 'man.it.1'
+ },
+ {
+ 'doc' => 'spaces in the directory and file names',
+ 'po4a.conf' => 'cfg/space_in_name/po4a.conf',
+ 'closed_path' => 'cfg/*/',
+ 'expected_files' => 'some\ directory space\ in\ name.fr.po space\ in\ name.pot',
+ },
+ {
+ 'doc' => 'Just like single-uptodate, but with the config file in DOS encoding',
+ 'po4a.conf' => 'cfg/windows-CRLF/windows-CRLF.conf',
+ 'closed_path' => 'cfg/*/',
+ 'expected_files' => 'single-uptodate.fr.po single-uptodate.pot single-uptodate.man.fr.1',
+
+ };
+
+run_all_tests(@tests);
+
+0;