[Commits] [SCM] clawsker branch, master, updated. 1.3.0-27-g4dd42f9

mones at claws-mail.org mones at claws-mail.org
Sat Dec 29 13:31:13 CET 2018


The branch, master has been updated
       via  4dd42f9508567344480e24ada422e788623e26f2 (commit)
      from  e777a91bedbf6a27806026e8b39d3c5ebb2eb506 (commit)

Summary of changes:
 t/parse_command_line.t |   40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 t/parse_command_line.t


- Log -----------------------------------------------------------------
commit 4dd42f9508567344480e24ada422e788623e26f2
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sat Dec 29 13:30:35 2018 +0100

    Add another forgotten test

diff --git a/t/parse_command_line.t b/t/parse_command_line.t
new file mode 100644
index 0000000..f84a9a7
--- /dev/null
+++ b/t/parse_command_line.t
@@ -0,0 +1,40 @@
+use 5.010_000;
+use strict;
+use utf8;
+use Test::More tests => 10;
+use Test::Exception;
+use File::Spec::Functions;
+
+my ($clawsrc, $accountrc, $menurc);
+
+BEGIN {
+    $clawsrc = catfile ($ENV{'XDG_RUNTIME_DIR'}, 'clawsrc');
+    $accountrc = catfile ($ENV{'XDG_RUNTIME_DIR'}, 'accountrc');
+    $menurc = catfile ($ENV{'XDG_RUNTIME_DIR'}, 'menurc');
+};
+
+local %ENV;
+$ENV{'DISPLAY'} = ''; # avoid error dialogs
+
+require_ok ('Clawsker');
+
+use Clawsker;
+
+ok ( defined &Clawsker::parse_command_line, 'has function' );
+
+dies_ok { Clawsker::parse_command_line(['--invalid']) } 'invalid option';
+
+dies_ok { Clawsker::parse_command_line(['--alternate-config-dir']) } '--alternate-config-dir';
+
+dies_ok { Clawsker::parse_command_line(['--alternate-config-dir', '/notexisting']) } '--alternate-config-dir';
+
+lives_ok { Clawsker::parse_command_line(['--alternate-config-dir', '.']) } '--alternate-config-dir ok';
+
+lives_ok { Clawsker::parse_command_line(['--verbose']) } '--verbose';
+
+dies_ok { Clawsker::parse_command_line(['--clawsrc']) } '--clawsrc';
+
+lives_ok { Clawsker::parse_command_line(['--help']) } '--help';
+
+lives_ok { Clawsker::parse_command_line(['--version']) } '--version';
+

-----------------------------------------------------------------------


hooks/post-receive
-- 
Hidden preferences editor for Claws Mail


More information about the Commits mailing list