koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/t Charset.t,1.1,1.2


From: Ambrose Li
Subject: [Koha-cvs] CVS: koha/t Charset.t,1.1,1.2
Date: Sat, 01 Feb 2003 23:18:40 -0800

Update of /cvsroot/koha/koha/t
In directory sc8-pr-cvs1:/tmp/cvs-serv1397/t

Modified Files:
        Charset.t 
Log Message:
Moved C4/Charset.pm to C4/Interface/CGI/Output.pm

Create output_html_with_http_headers function to contain the "print $query
->header(-type => guesstype...),..." call. This is in preparation for
non-HTML output (e.g., text/xml) and charset conversion before output in
the future.

Created C4/Interface/CGI/Template.pm to hold convenience functions specific
to the CGI interface using HTML::Template

Modified moremembers.pl to make the "sex" field localizable for languages
where M and F doesn't make sense


Index: Charset.t
===================================================================
RCS file: /cvsroot/koha/koha/t/Charset.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Charset.t   19 Jan 2003 06:15:44 -0000      1.1
--- Charset.t   2 Feb 2003 07:18:38 -0000       1.2
***************
*** 1,4 ****
  use strict;
! use C4::Charset;
  
  use vars qw( @tests );
--- 1,4 ----
  use strict;
! use C4::Interface::CGI::Output;
  
  use vars qw( @tests );
***************
*** 9,13 ****
     [
        'Normal HTML without meta tag',
!       sub { C4::Charset::guesscharset($_[0]) },
        undef,
        <<EOF
--- 9,13 ----
     [
        'Normal HTML without meta tag',
!       sub { guesscharset($_[0]) },
        undef,
        <<EOF
***************
*** 16,20 ****
     ], [
        'Result of guesscharset with normal HTML with irrelevant meta tag',
!       sub { C4::Charset::guesscharset($_[0]) },
        undef,
        <<EOF
--- 16,20 ----
     ], [
        'Result of guesscharset with normal HTML with irrelevant meta tag',
!       sub { guesscharset($_[0]) },
        undef,
        <<EOF
***************
*** 22,28 ****
  EOF
     ], [
!       'Result of guesscharset with normal HTML with irrelevant meta tag',
!       sub { C4::Charset::guesstype($_[0]) },
!       undef,
        <<EOF
  <meta http-equiv="Content-Language" content="zh-TW">
--- 22,28 ----
  EOF
     ], [
!       'Result of guesstype with normal HTML with irrelevant meta tag',
!       sub { guesstype($_[0]) },
!       'text/html',
        <<EOF
  <meta http-equiv="Content-Language" content="zh-TW">
***************
*** 30,34 ****
     ], [
        'Result of guesscharset with normal HTML with relevant meta tag',
!       sub { C4::Charset::guesscharset($_[0]) },
        'big5',
        <<EOF
--- 30,34 ----
     ], [
        'Result of guesscharset with normal HTML with relevant meta tag',
!       sub { guesscharset($_[0]) },
        'big5',
        <<EOF
***************
*** 37,41 ****
     ], [
        'Result of guesstype with normal HTML with relevant meta tag',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
--- 37,41 ----
     ], [
        'Result of guesstype with normal HTML with relevant meta tag',
!       sub { guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
***************
*** 44,48 ****
     ], [
        'Variant 1 using single quotes',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=iso-2022-jp',
        <<EOF
--- 44,48 ----
     ], [
        'Variant 1 using single quotes',
!       sub { guesstype($_[0]) },
        'text/html; charset=iso-2022-jp',
        <<EOF
***************
*** 51,55 ****
     ], [
        'Variant 2 using single quotes',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=utf-8',
        <<EOF
--- 51,55 ----
     ], [
        'Variant 2 using single quotes',
!       sub { guesstype($_[0]) },
        'text/html; charset=utf-8',
        <<EOF
***************
*** 58,62 ****
     ], [
        'Unquoted Content-Type',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
--- 58,62 ----
     ], [
        'Unquoted Content-Type',
!       sub { guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
***************
*** 65,69 ****
     ], [
        'XML syntax',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=iso-8859-2',
        <<EOF
--- 65,69 ----
     ], [
        'XML syntax',
!       sub { guesstype($_[0]) },
        'text/html; charset=iso-8859-2',
        <<EOF
***************
*** 72,76 ****
     ], [
        'Expected attributes in reverse order',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
--- 72,76 ----
     ], [
        'Expected attributes in reverse order',
!       sub { guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
***************
*** 79,83 ****
     ], [
        'Extra whitespace at end',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
--- 79,83 ----
     ], [
        'Extra whitespace at end',
!       sub { guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
***************
*** 86,90 ****
     ], [
        'Multiple lines',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
--- 86,90 ----
     ], [
        'Multiple lines',
!       sub { guesstype($_[0]) },
        'text/html; charset=big5',
        <<EOF
***************
*** 95,100 ****
  EOF
     ], [
        'With surrounding HTML',
!       sub { C4::Charset::guesstype($_[0]) },
        'text/html; charset=us-ascii',
        <<EOF
--- 95,101 ----
  EOF
     ], [
+       # FIXME - THIS IS NOT A WELL-WRITTEN TEST CASE!!!
        'With surrounding HTML',
!       sub { guesstype($_[0]) },
        'text/html; charset=us-ascii',
        <<EOF
***************
*** 132,142 ****
        || (defined $output && defined $expected && $output eq $expected)
     ) {
!       print "ok $i ($title)\n";
     } else {
!       print "not ok $i ($title: got ",
            (defined $output? "\"$output\"": 'undef'),
            ', expected ',
            (defined $expected? "\"$expected\"": 'undef'),
!           ")\n";
     }
  }
--- 133,143 ----
        || (defined $output && defined $expected && $output eq $expected)
     ) {
!       print "ok $i - $title\n";
     } else {
!       print "not ok $i - $title: got ",
            (defined $output? "\"$output\"": 'undef'),
            ', expected ',
            (defined $expected? "\"$expected\"": 'undef'),
!           "\n";
     }
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]