From 8d25800c67ad65defd98771bba2331ee64104f98 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 7 Jan 2009 12:51:13 +0000 Subject: feed fatti, e pure col test manca: testare feed intl, fare feed dei tag, mettere i tag nei feed git-svn-id: svn://luxion/repos/WebCoso/trunk@402 fcb26f47-9200-0410-b104-b98ab5b095f3 --- t/test-site-output/feed.it.xml | 12 ++++++++++ t/test-site/src/common/base-feed.tt | 18 +++++++++++++++ t/test-site/src/common/du2html.xsl | 16 +++++++++++-- t/test-site/src/common/fillFeed.xsl | 46 ++++++++++++++++++++++++++----------- t/test-site/src/feed.it.tt | 15 +----------- t/whole-01.t | 6 ++--- 6 files changed, 81 insertions(+), 32 deletions(-) create mode 100644 t/test-site-output/feed.it.xml create mode 100644 t/test-site/src/common/base-feed.tt (limited to 't') diff --git a/t/test-site-output/feed.it.xml b/t/test-site-output/feed.it.xml new file mode 100644 index 0000000..df11489 --- /dev/null +++ b/t/test-site-output/feed.it.xml @@ -0,0 +1,12 @@ + + +Gianni Ceccarellidakkar@thenautilus.nethttp://www.thenautilus.net/thenautilus.net2008-03-01T09:36:00+00002008-02-29T21:09:09+0000/bar/baz/
bar-baz italiano +

sticaz +

2008-02-29T21:09:09+0000/foo/
Pagina foo

foo +

2008-03-01T09:06:41+0000/bar/
bar (generato) +
  • line 1 +
  • line 2 +
  • line 3 +

link: bar-baz italiano +

2008-03-01T09:36:00+0000/
Pagina principale +
diff --git a/t/test-site/src/common/base-feed.tt b/t/test-site/src/common/base-feed.tt new file mode 100644 index 0000000..e2669e3 --- /dev/null +++ b/t/test-site/src/common/base-feed.tt @@ -0,0 +1,18 @@ +[% USE df = DateTime::Format('DateTime::Format::Strptime', + { pattern => '%FT%T%z', + locale => 'en_US', + time_zone => 'GMT' }) -%] +[% USE Dumper -%] +[% docs=changed.nsortf('last_change') -%] + + +[% l=docs.last;df.format(changed.$l.last_change) %] +[% FOR doc IN docs; NEXT UNLESS isLang(language,doc) -%] + + [% IF changed.$doc.creation %][% df.format(changed.$doc.creation) %][% END %] + [% IF changed.$doc.last_change %][% df.format(changed.$doc.last_change) %][% END %] + [% atomIdFor(language,doc,path) %] + [% dstUriFor(doc,path) %] + +[% END -%] + diff --git a/t/test-site/src/common/du2html.xsl b/t/test-site/src/common/du2html.xsl index 88c70b0..8b73a82 100644 --- a/t/test-site/src/common/du2html.xsl +++ b/t/test-site/src/common/du2html.xsl @@ -15,6 +15,15 @@ doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" indent="yes"/> + + @@ -23,14 +32,14 @@ - + - + @@ -39,6 +48,9 @@ + + diff --git a/t/test-site/src/common/fillFeed.xsl b/t/test-site/src/common/fillFeed.xsl index e6077eb..04a6de3 100644 --- a/t/test-site/src/common/fillFeed.xsl +++ b/t/test-site/src/common/fillFeed.xsl @@ -1,7 +1,8 @@ @@ -13,23 +14,42 @@ - - - - - + + + + Gianni Ceccarelli + dakkar@thenautilus.net + + http://www.thenautilus.net/ + + thenautilus.net + + + - - + + + + + + + + - - - - + + + +
+ +
+
+ +
- +
+
\ No newline at end of file diff --git a/t/test-site/src/feed.it.tt b/t/test-site/src/feed.it.tt index 9a7a4cd..f7b7730 100644 --- a/t/test-site/src/feed.it.tt +++ b/t/test-site/src/feed.it.tt @@ -1,14 +1 @@ -[% USE df = DateTime::Format('DateTime::Format::Strptime', - { pattern => '%F %T', - locale => 'en_US', - time_zone => 'GMT' }) -%] - - -[% FOR c IN changed; NEXT UNLESS isLang(language,c.key) -%] - - [% IF c.value.creation %][% df.format(c.value.creation) %][% END %] - [% IF c.value.last_change %][% df.format(c.value.last_change) %][% END %] - [% dstUriFor(c.key) %] - -[% END -%] - +[% INCLUDE 'base-feed.tt' %] diff --git a/t/whole-01.t b/t/whole-01.t index 639ecc0..f270c5e 100644 --- a/t/whole-01.t +++ b/t/whole-01.t @@ -8,13 +8,13 @@ chdir file(__FILE__)->parent->parent->stringify; $ENV{PERL5LIB}=join ':',@INC; -system($^X,qw(blib/script/webcoso.pl -s t/test-site/src/ -d t/test-site/output/ -I t/test-site/common/ --clean)) +system($^X,qw(blib/script/webcoso.pl -s t/test-site/src/ -d t/test-site/output/ -I t/test-site/src/common/ --clean)) and die "Problems running webcoso.pl (clean): $?\n"; -system($^X,qw(blib/script/webcoso.pl -s t/test-site/src/ -d t/test-site/output/ -I t/test-site/common/)) +system($^X,qw(blib/script/webcoso.pl -s t/test-site/src/ -d t/test-site/output/ -I t/test-site/src/common/)) and die "Problems running webcoso.pl: $?\n"; is(system(qw(diff -r -x .svn -I),'\(Ultima modifica\|Latest change\)',qw(t/test-site/output/ t/test-site-output/)),0,'output as expected'); -system($^X,qw(blib/script/webcoso.pl -s t/test-site/src/ -d t/test-site/output/ -I t/test-site/common/ --clean)) +system($^X,qw(blib/script/webcoso.pl -s t/test-site/src/ -d t/test-site/output/ -I t/test-site/src/common/ --clean)) and die "Problems running webcoso.pl (clean): $?\n"; -- cgit v1.2.3