File: 1.t

package info (click to toggle)
libpoe-filter-ircd-perl 2.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 64 kB
  • ctags: 11
  • sloc: perl: 155; makefile: 47
file content (24 lines) | stat: -rw-r--r-- 894 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1.t'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

use Test::More tests => 7;
BEGIN { use_ok('POE::Filter::IRCD') };

my ($filter) = POE::Filter::IRCD->new();

isa_ok( $filter, 'POE::Filter::IRCD' );

my $original = ':test!test@test.test PRIVMSG #Test :This is a test case';
foreach my $irc_event ( @{ $filter->get( [ $original ] ) } ) {
  ok( $irc_event->{prefix} eq 'test!test@test.test', 'Prefix Test' );
  ok( $irc_event->{params}->[0] eq '#Test', 'Params Test One' );
  ok( $irc_event->{params}->[1] eq 'This is a test case', 'Params Test Two' );
  ok( $irc_event->{command} eq 'PRIVMSG', 'Command Test');
  foreach my $parsed ( @{ $filter->put( [ $irc_event ] ) } ) {
	ok( $parsed eq $original, 'Self Test' );
  }
}