Annotation of todotxt/Text-Todo/t/special_tags.t, Revision 1.6
1.1 andrew 1: #===============================================================================
2: #
3: # FILE: special_tags.t
4: #
5: # DESCRIPTION: Test special tags
6: #
7: # AUTHOR: Andrew Fresh (AAF), andrew@cpan.org
8: # COMPANY: Red River Communications
9: # CREATED: 01/09//10 17:43
1.6 ! andrew 10: # REVISION: $AFresh1: special_tags.t,v 1.5 2010/01/15 19:50:15 andrew Exp $
1.1 andrew 11: #===============================================================================
12:
13: use strict;
14: use warnings;
15:
1.6 ! andrew 16: use Test::More tests => 8;
1.1 andrew 17:
1.5 andrew 18: my $class;
19: BEGIN {
20: $class = 'Text::Todo::Entry';
21: use_ok( $class, "use $class" )
22: }
1.1 andrew 23:
24: diag("Testing special tags in $class $Text::Todo::Entry::VERSION");
25:
26: my %sample = (
27: text => '(B) @home @work send email to andrew@cpan.org DUE:2011-01-01 +say_thanks',
28:
1.6 ! andrew 29: known_tags => {
! 30: context => '@',
! 31: project => '+',
! 32: due_date => 'DUE:',
! 33: },
! 34:
1.1 andrew 35: priority => 'B',
36: contexts => [ 'home', 'work' ],
37: projects => ['say_thanks'],
38: due_dates => ['2011-01-01'],
39: );
40:
41: my $e = new_ok($class, [ {text => $sample{text}, tags => { due_date => 'DUE:' }} ]);
1.6 ! andrew 42:
! 43: is_deeply( $e->known_tags, $sample{known_tags}, 'check known_tags' );
1.1 andrew 44:
45: is( $e->text, $sample{text}, 'Make sure entry matches' );
46: is( $e->priority, $sample{priority}, 'check priority' );
47: is_deeply( [ $e->contexts ], $sample{contexts}, 'check contexts' );
48: is_deeply( [ $e->projects ], $sample{projects}, 'check projects' );
49:
50: is_deeply( [ $e->due_dates ], $sample{due_dates}, 'check due_dates');
51:
1.2 andrew 52: #done_testing();
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>