Changeset 1024


Ignore:
Timestamp:
Apr 21, 2007, 2:17:26 PM (14 years ago)
Author:
kake
Message:

Fix to [1023] - I misunderstood how the format parameter should be supplied.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides/Search.pm

    r1023 r1024  
    170170
    171171    my $want_raw;
    172     if ( $args{format} && $args{format} eq "raw" ) {
     172    if ( $args{vars}{format} && $args{vars}{format} eq "raw" ) {
    173173        $want_raw = 1;
    174174    }
  • trunk/t/30_search_raw.t

    r1023 r1024  
    2424my %results;
    2525
    26 %results = $search->run( format => "raw" );
     26%results = $search->run( vars => { format => "raw" } );
    2727is_deeply( \%results, { },
    2828           "raw search returns empty hash if no criteria supplied" );
    29 %results = $search->run( vars => { search => "banananana" }, format => "raw" );
     29%results = $search->run( vars => { search => "banananana", format => "raw" } );
    3030is_deeply( \%results, { },
    3131           "raw search returns empty hash if no hits on search string" );
     
    5454                            );
    5555
    56 %results = $search->run( vars => { search => "arms" }, format => "raw" );
     56%results = $search->run( vars => { search => "arms", format => "raw" } );
    5757is_deeply( [ sort keys %results ], [ "Blacksmiths Arms", "Carpenters Arms" ],
    5858           "raw search on single word finds the right nodes" );
     
    6767# Now try a distance search.
    6868%results = $search->run(
    69     vars => { os_dist => 1000, os_x => 500200, os_y => 150000 },
    70     format => "raw" );
     69                         vars => {
     70                                   os_dist => 1000,
     71                                   os_x    => 500200,
     72                                   os_y    => 150000,
     73                                   format  => "raw",
     74                                 } );
    7175is_deeply( [ sort keys %results ], [ "Blacksmiths Arms", "Red Lion" ],
    7276           "raw distance search finds the right nodes" );
Note: See TracChangeset for help on using the changeset viewer.