Bugzilla – Attachment 4697 Details for
Bug 6458
incorrect parsing result in translation processing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Amended proposed patch
0001-Bug-6458-Template-Toolkit-files-test-case.patch (text/plain), 2.90 KB, created by
Frédéric Demians
on 2011-07-21 11:06:25 UTC
(
hide
)
Description:
Amended proposed patch
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2011-07-21 11:06:25 UTC
Size:
2.90 KB
patch
obsolete
>From 2d351f468f57124a87f504f29bfe58ca185e7c1f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Thu, 21 Jul 2011 10:18:29 +0200 >Subject: [PATCH] Bug 6458 Template Toolkit files test case > >This test validate Template Toolkit (TT) Koha files. > >For the time being an unique validation is done: Test if TT files contain TT >directive within HTML tag. For example: > > <li[% IF > >This kind of constuction MUST be avoided because it break Koha translation >process. >--- > xt/tt_valid.t | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 78 insertions(+), 0 deletions(-) > create mode 100755 xt/tt_valid.t > >diff --git a/xt/tt_valid.t b/xt/tt_valid.t >new file mode 100755 >index 0000000..3ccedba >--- /dev/null >+++ b/xt/tt_valid.t >@@ -0,0 +1,78 @@ >+#!/usr/bin/perl >+ >+# Copyright (C) 2011 Tamil s.a.r.l. >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use warnings; >+use strict; >+use Test::More tests => 1; >+use File::Find; >+use Cwd; >+ >+ >+my @files_with_directive_in_tag = do { >+ my @files; >+ find( sub { >+ my $dir = getcwd(); >+ return if $dir =~ /blib/; >+ return unless /\.(tt)$/; >+ open my $fh, "<", $_; >+ my $name = $_; >+ my $line = 1; >+ my @lines; >+ while ( <$fh> ) { >+ push @lines, $line if /<([a-z]*)\s*\[/i; >+ $line++; >+ } >+ ($dir) = $dir =~ /koha-tmpl\/(.*)$/; >+ push @files, { name => "$dir/$name", lines => \@lines } if @lines; >+ }, ( './koha-tmpl/opac-tmpl/prog/en', './koha-tmpl/intranet-tmpl/prog/en' ) ); >+ @files; >+}; >+ >+ >+ok( !@files_with_directive_in_tag, "TT syntax: not using TT directive within HTML tag" ) >+ or diag( "Files list: \n", >+ join( "\n", map {$_->{name} . ': ' . join(', ', @{$_->{lines}}) >+ } @files_with_directive_in_tag ) ); >+ >+ >+ >+=head1 NAME >+ >+tt_valid.t >+ >+=head1 DESCRIPTION >+ >+This test validate Template Toolkit (TT) Koha files. >+ >+For the time being an unique validation is done: Test if TT files contain TT >+directive within HTML tag. For example: >+ >+ <li[% IF >+ >+This kind of constuction MUST be avoided because it break Koha translation >+process. >+ >+=head1 USAGE >+ >+From Koha root directory: >+ >+prove -v xt/tt_valid.t >+ >+=cut >+ >-- >1.7.5.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6458
:
4695
|
4697
|
4699
|
4729
|
4968
|
5070
|
5071
|
5072
|
5074
|
5078
|
5079
|
5080
|
5081
|
5082
|
5090
|
5091
|
5092
|
5093
|
5094
|
5095
|
5096
|
5121
|
5125
|
5126
|
5127
|
5128
|
5129
|
5130
|
5131
|
5132
|
5133
|
5147
|
5148
|
5149
|
5150
|
5152
|
5153
|
5155
|
5156
|
5157
|
5158
|
5159
|
5160
|
5168
|
5169
|
5170
|
5258
|
5259
|
5260
|
5261
|
5262
|
5263
|
5273
|
5274
|
5286
|
5287
|
5288
|
5289
|
5292
|
5293
|
5299
|
5300
|
5416
|
5417
|
5418
|
5419
|
5420
|
5425
|
5426
|
5427