From 3a7d684e2392a3b151fdb80103c5200d837c14ca Mon Sep 17 00:00:00 2001 From: tetragon Date: Sun, 20 May 2007 00:34:30 +0000 Subject: Update LedgerSMB.pm tests to reflect that calls to error will no longer fail git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1220 4979c152-3d1c-0410-bac9-87ea11338e46 --- t/11-ledgersmb.t | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 't') diff --git a/t/11-ledgersmb.t b/t/11-ledgersmb.t index a221cb0e..1b418164 100644 --- a/t/11-ledgersmb.t +++ b/t/11-ledgersmb.t @@ -17,6 +17,10 @@ sub redirect { print "redirected\n"; } +sub lsmb_error_func { + print $_[0]; +} + ##line subroutine ##108 new ##235 redirect @@ -175,12 +179,15 @@ ok(defined $lsmb->{menubar}, 'new: lynx, menubar defined (deprecated)'); is($lsmb->{menubar}, 1, 'new: lynx, menubar enabled (deprecated)'); ok(defined $lsmb->{version}, 'new: lynx, version defined'); -TODO: { - local $TODO = 'Error handling for LedgerSMB'; - @r = trap{new LedgerSMB('script=foo/bar.pl')}; - is($trap->die, "Error: Access Denied\n", - 'new: directory traversal caught'); -} +@r = trap{new LedgerSMB('script=foo/bar.pl')}; +is($trap->die, "Error: Access Denied\n", + 'new: directory traversal 1 caught'); +@r = trap{new LedgerSMB('script=foo\\bar.pl')}; +is($trap->die, "Error: Access Denied\n", + 'new: directory traversal 2 caught'); +@r = trap{new LedgerSMB('script=..')}; +is($trap->die, "Error: Access Denied\n", + 'new: directory traversal 3 caught'); # $lsmb->redirect checks $lsmb = new LedgerSMB; -- cgit v1.2.3