Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv2413
Modified Files:
TestMailParse.tst
Log Message:
decode_string tests
Index: TestMailParse.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestMailParse.tst,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TestMailParse.tst 13 Jul 2003 02:40:35 -0000 1.11
--- TestMailParse.tst 18 Jul 2003 05:09:42 -0000 1.12
***************
*** 44,57 ****
# map_color()
! test_assert_equal( $cl->map_color( 'red' ), 'ff0000' );
! test_assert_equal( $cl->map_color( 'ff0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( 'FF0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( '#fF0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( '#Ff0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( 'white' ), 'ffffff' );
! test_assert_equal( $cl->map_color( 'fFfFFf' ), 'ffffff' );
! test_assert_equal( $cl->map_color( 'FFFFFF' ), 'ffffff' );
! test_assert_equal( $cl->map_color( '#ffffff' ), 'ffffff' );
! test_assert_equal( $cl->map_color( '#FFfFFF' ), 'ffffff' );
# Check line splitting into words
--- 44,57 ----
# map_color()
! test_assert_equal( $cl->map_color( 'red' ), 'ff0000' );
! test_assert_equal( $cl->map_color( 'ff0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( 'FF0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( '#fF0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( '#Ff0000' ), 'ff0000' );
! test_assert_equal( $cl->map_color( 'white' ), 'ffffff' );
! test_assert_equal( $cl->map_color( 'fFfFFf' ), 'ffffff' );
! test_assert_equal( $cl->map_color( 'FFFFFF' ), 'ffffff' );
! test_assert_equal( $cl->map_color( '#ffffff' ), 'ffffff' );
! test_assert_equal( $cl->map_color( '#FFfFFF' ), 'ffffff' );
# Check line splitting into words
***************
*** 137,141 ****
test_assert_equal( defined( $cl->{words__}{invisible} ), '' );
! # glob the tests directory for files called TestMailParse\d+.msg which consist of messages
# to be parsed with the resulting values for the words hash in TestMailParse\d+.wrd
--- 137,141 ----
test_assert_equal( defined( $cl->{words__}{invisible} ), '' );
! # glob the tests directory for files called TestMailParse\d+.msg which consist of messages
# to be parsed with the resulting values for the words hash in TestMailParse\d+.wrd
***************
*** 145,149 ****
my $words = $parse_test;
$words =~ s/msg/wrd/;
!
# Parse the document and then check the words hash against the words in the
# wrd file
--- 145,149 ----
my $words = $parse_test;
$words =~ s/msg/wrd/;
!
# Parse the document and then check the words hash against the words in the
# wrd file
***************
*** 186,190 ****
my $colored = $color_test;
$colored =~ s/msg/clr/;
!
$cl->{color__} = 1;
$cl->{bayes__} = $b;
--- 186,190 ----
my $colored = $color_test;
$colored =~ s/msg/clr/;
!
$cl->{color__} = 1;
$cl->{bayes__} = $b;
***************
*** 197,198 ****
--- 197,207 ----
test_assert_equal( $check, $html );
}
+
+
+ # test decode_string
+
+ test_assert_equal($cl->decode_string("=?ISO-8859-1?Q?foo?="), "foo");
+ test_assert_equal($cl->decode_string("=?ISO-8859-1?Q?foo_bar?="), "foo bar");
+ test_assert_equal($cl->decode_string("=?ISO-8859-1?Q?foo=20bar?="), "foo bar");
+ 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");
|