Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv18366/tests
Modified Files:
TestMailParse.tst TestMailParse022.cam TestMailParse022.msg
TestMailParse022.wrd
Log Message:
Tests for get_header, first20 and quickmagnets; fix bug in quickmagnets handling of the from address
Index: TestMailParse.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestMailParse.tst,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** TestMailParse.tst 26 Jul 2003 21:17:19 -0000 1.13
--- TestMailParse.tst 26 Jul 2003 21:47:01 -0000 1.14
***************
*** 206,209 ****
--- 206,211 ----
}
+ $cl->{color__} = 0;
+
# test decode_string
***************
*** 213,214 ****
--- 215,253 ----
test_assert_equal($cl->decode_string("=?ISO-8859-1?Q?foo_bar?= =?ISO-8859-1?Q?foo_bar?="), "foo bar foo bar");
test_assert_equal($cl->decode_string("=?ISO-8859-1?B?QWxhZGRpbjpvcGVuIHNlc2FtZQ==?= =?ISO-8859-1?B?QWxhZGRpbjpvcGVuIHNlc2FtZQ==?="), "Aladdin:open sesame Aladdin:open sesame");
+
+ # test get_header
+
+ $cl->parse_file( 'TestMailParse022.msg' );
+ test_assert_equal( $cl->get_header( 'from', 'te...@te...' ) );
+ test_assert_equal( $cl->get_header( 'to', 'so...@so...' ) );
+ test_assert_equal( $cl->get_header( 'cc', 'som...@so...' ) );
+ test_assert_equal( $cl->get_header( 'subject', 'test for various HTML parts' ) );
+
+ # test quickmagnets
+
+ my %qm = %{$cl->quickmagnets()};
+ my @from = @{$qm{from}};
+ my @to = @{$qm{to}};
+ my @cc = @{$qm{cc}};
+ my @subject = @{$qm{subject}};
+ test_assert_equal( $#from, 1 );
+ test_assert_equal( $from[0], 'te...@te...' );
+ test_assert_equal( $from[1], 'test.com' );
+ test_assert_equal( $#to, 1 );
+ test_assert_equal( $to[0], 'so...@so...' );
+ test_assert_equal( $to[1], 'somewhere.com' );
+ test_assert_equal( $#cc, 1 );
+ test_assert_equal( $cc[0], 'som...@so...' );
+ test_assert_equal( $cc[1], 'somewhere.com' );
+ test_assert_equal( $#subject, 2 );
+ test_assert_equal( $subject[0], 'test' );
+ test_assert_equal( $subject[1], 'various' );
+ test_assert_equal( $subject[2], 'parts' );
+
+ # test first20
+
+ $cl->parse_file( 'TestMailParse022.msg' );
+ test_assert_equal( $cl->first20(), ' This is the title image' );
+ $cl->parse_file( 'TestMailParse021.msg' );
+ test_assert_equal( $cl->first20(), ' Take Control of Your Computer With This Top of the Line Software Norton SystemWorks Software Suite Professional Edition Includes Six' );
+
Index: TestMailParse022.cam
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestMailParse022.cam,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestMailParse022.cam 26 Jul 2003 21:17:19 -0000 1.2
--- TestMailParse022.cam 26 Jul 2003 21:47:02 -0000 1.3
***************
*** 1,4 ****
--- 1,5 ----
From: te...@te...
To: so...@so...
+ Cc: <som...@so...>
Subject: [spam] test for various HTML parts
X-Text-Classification: spam
***************
*** 19,22 ****
--- 20,25 ----
<form action="mailto:so...@ou..."></form>
+
+ <a href="http://0x10.0x20.0x30.0x40/"><a href="http://10.20.30.40/"><a href="http://010.020.030.040/">
</body>
Index: TestMailParse022.msg
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestMailParse022.msg,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestMailParse022.msg 26 Jul 2003 21:17:19 -0000 1.2
--- TestMailParse022.msg 26 Jul 2003 21:47:02 -0000 1.3
***************
*** 1,4 ****
--- 1,5 ----
From: te...@te...
To: so...@so...
+ Cc: <som...@so...>
Subject: test for various HTML parts
***************
*** 17,20 ****
--- 18,23 ----
<form action="mailto:so...@ou..."></form>
+
+ <a href="http://0x10.0x20.0x30.0x40/"><a href="http://10.20.30.40/"><a href="http://010.020.030.040/">
</body>
Index: TestMailParse022.wrd
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestMailParse022.wrd,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestMailParse022.wrd 26 Jul 2003 21:17:19 -0000 1.1
--- TestMailParse022.wrd 26 Jul 2003 21:47:02 -0000 1.2
***************
*** 24,26 ****
bodysound.com 1
www.bodysound.com 1
!
--- 24,31 ----
bodysound.com 1
www.bodysound.com 1
! 10.20.30.40 1
! 16.32.48.64 1
! 8.16.24.32 1
! header:Cc 1
! cc:som...@so... 1
! cc:somewhere.com 1
|