From 556ea57a7ce1e072f5360c00f5cef2406dff794f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 18 May 2011 07:57:43 +0200 Subject: Increase Test Coverage --- t/29-app-hashl.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/29-app-hashl.t b/t/29-app-hashl.t index 20d0734..c14aca1 100644 --- a/t/29-app-hashl.t +++ b/t/29-app-hashl.t @@ -3,7 +3,7 @@ use strict; use warnings; use 5.010; -use Test::More tests => 22; +use Test::More tests => 28; use_ok('App::Hashl'); @@ -48,11 +48,24 @@ is_deeply($hashl->file('t/in/4'), ok($hashl->file_in_db('t/in/4'), 'file is now in db'); ok($hashl->hash_in_db($test_hash), 'hash is in db'); +ok($hashl->add_file( + file => 't/in/1k', + path => 't/in/1k', + ), + 'Add another file' +); +is_deeply([$hashl->files()], [qw[t/in/1k t/in/4]], 'Both files in list'); +ok($hashl->file_in_db('t/in/1k'), 'file in db'); +ok($hashl->file_in_db('t/in/4'), 'other file in db'); + ok($hashl->ignore('t/in/4', 't/in/4'), 'ignore file'); is($hashl->file_in_db('t/in/4'), $IGNORED, 'file no longer in db'); is_deeply([$hashl->ignored()], [$test_hash], 'file is ignored'); +ok($hashl->ignore('t/in/1k', 't/in/1k'), 'ignore other file as well'); +is($hashl->file_in_db('t/in/1k'), $IGNORED, 'file ignored'); + ok($hashl->save('t/in/hashl.db'), 'save db'); undef $hashl; -- cgit v1.2.3