From 44d035fe38dac0b91e1fdadb576459f5ec19739a Mon Sep 17 00:00:00 2001 From: tetragon Date: Thu, 17 May 2007 21:15:52 +0000 Subject: Merging Inifile and Menu into Menufile Fixed a scope bug in Menufile, and added more tests git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1204 4979c152-3d1c-0410-bac9-87ea11338e46 --- t/01-load.t | 5 +- t/10-form.t | 65 ++++++++++++++---------- t/11-ledgersmb.t | 2 +- t/12-menufile.t | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++ t/98-pod-coverage.t | 19 +++++++ t/data/12-menu1.ini | 5 ++ t/data/12-menu2.ini | 9 ++++ t/data/12-menu3.ini | 9 ++++ t/data/12-menu4.ini | 19 +++++++ 9 files changed, 244 insertions(+), 32 deletions(-) create mode 100644 t/12-menufile.t create mode 100644 t/98-pod-coverage.t create mode 100644 t/data/12-menu1.ini create mode 100644 t/data/12-menu2.ini create mode 100644 t/data/12-menu3.ini create mode 100644 t/data/12-menu4.ini (limited to 't') diff --git a/t/01-load.t b/t/01-load.t index 8b83013e..60461f02 100644 --- a/t/01-load.t +++ b/t/01-load.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 31; +use Test::More tests => 30; use_ok('LedgerSMB'); use_ok('LedgerSMB::AA'); @@ -17,12 +17,11 @@ use_ok('LedgerSMB::HR'); use_ok('LedgerSMB::IC'); use_ok('LedgerSMB::IR'); use_ok('LedgerSMB::IS'); -use_ok('LedgerSMB::Inifile'); +use_ok('LedgerSMB::Menufile'); use_ok('LedgerSMB::JC'); use_ok('LedgerSMB::Locale'); use_ok('LedgerSMB::Log'); use_ok('LedgerSMB::Mailer'); -use_ok('LedgerSMB::Menu'); use_ok('LedgerSMB::Num2text'); use_ok('LedgerSMB::OE'); use_ok('LedgerSMB::OP'); diff --git a/t/10-form.t b/t/10-form.t index 6c170a80..2a5765e5 100644 --- a/t/10-form.t +++ b/t/10-form.t @@ -1,35 +1,25 @@ #!/usr/bin/perl -##format_amount in 02-number-handling.t -##parse_amount in 02-number-handling.t -##round_amount in 02-number-handling.t -##current_date in 03-date-handling.t -##split_date in 03-date-handling.t -##format_date in 03-date-handling.t -##from_to in 03-date-handling.t -##datetonum in 03-date-handling.t -##add_date in 03-date-handling.t - -##escape in 10-form.t -##unescape in 10-form.t -##quote in 10-form.t -##unquote in 10-form.t -##numtextrows in 10-form.t -##debug in 10-form.t -##hide_form in 10-form.t -##info in 10-form.t -##error in 10-form.t -##isblank in 10-form.t -##header in 10-form.t -##sort_columns in 10-form.t -##sort_order in 10-form.t -##print_button in 10-form.t - -##encode_all null -##decode_all null +# +# t/10-form.t +# +# Tests various functions in LedgerSMB::Form that aren't tested elsewhere. +# + +# format_amount in 02-number-handling.t +# parse_amount in 02-number-handling.t +# round_amount in 02-number-handling.t +# current_date in 03-date-handling.t +# split_date in 03-date-handling.t +# format_date in 03-date-handling.t +# from_to in 03-date-handling.t +# datetonum in 03-date-handling.t +# add_date in 03-date-handling.t + +# encode_all empty +# decode_all empty ##sub new { ##sub dberror { -##sub redirect { ##sub db_parse_numeric { ##sub callproc { ##sub get_my_emp_num { @@ -91,6 +81,10 @@ sub form_error_func { print $_[0]; } +sub redirect { + print "redirected\n"; +} + my $form = new Form; my %myconfig; my $utfstr; @@ -222,6 +216,7 @@ SKIP: { is($form->info('hello world'), 'hello world', 'info: CLI, function call'); }; +delete $ENV{info_function}; ## $form->error checks $form = new Form; @@ -415,3 +410,17 @@ is($trap->stdout, "