/[webpac2]/trunk/t/5-output-couchdb.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/t/5-output-couchdb.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1198 - (show annotations)
Thu May 28 10:15:20 2009 UTC (14 years, 10 months ago) by dpavlin
File MIME type: application/x-troff
File size: 892 byte(s)
output modules can now define add_row as opposed to add to get input row before normalization
1 #!/usr/bin/perl -w
2
3 use strict;
4 use blib;
5
6 use Test::More tests => 9;
7
8 BEGIN {
9 use lib 'lib';
10 use_ok( 'WebPAC::Test' );
11 use_ok( 'WebPAC::Output::CouchDB' );
12 use_ok( 'SWISH::API' );
13 }
14
15 my $path = "$abs_path/kino/";
16
17 ok(my $out = new WebPAC::Output::CouchDB({
18 url => 'http://193.198.212.57:5984',
19 database => 'webpac2',
20 %LOG
21 }), "new");
22
23 ok( $out->init, 'init' );
24
25 my $ds = {
26 'Source' => {
27 'name' => 'Izvor: ',
28 'search' => [ 'tko zna' ]
29 },
30 'ID' => {
31 'search' => [ 'id' ],
32 },
33 'Array' => {
34 'search' => [ qw/a1 a2 s3 a4 a5/ ],
35 },
36 'foo' => {
37 'search' => [ 'foo' ],
38 },
39 };
40
41 ok( $out->add_row( 42, $ds ), 'add 42' );
42
43 my @strange = ( qw/èajðinica odma¹æivanje ¾abokreèina ¹uma/ );
44
45 ok( $out->add_row( 99, { foo => { search => [ @strange ] } } ), 'add 99' );
46
47 ok( $out->add_row( 100, { foo => { search => [ qw/foo bar baz/ ] } } ), 'add 100' );
48
49 ok( $out->finish, 'finish' );
50

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26