To edit pages or tickets please login with username/password: aaf/aaf

root/trunk/demo/test/unit/sort_test.rb

Revision 201, 0.7 kB (checked in by jk, 1 year ago)

#155 - added support for Sort marshalling

Line 
1 require File.dirname(__FILE__) + '/../test_helper'
2
3 class SortTest < Test::Unit::TestCase
4   include Ferret::Search
5
6   def test_sort_marshalling
7     [ Sort.new,
8       Sort.new( [], :reverse => true) ,
9       Sort.new([ Ferret::Search::SortField.new(:id, :reverse => true),
10                  Ferret::Search::SortField::SCORE,
11                  Ferret::Search::SortField::DOC_ID ],
12                :reverse => true),
13       Sort.new([ Ferret::Search::SortField.new(:id),
14                  Ferret::Search::SortField::SCORE_REV,
15                  Ferret::Search::SortField::DOC_ID_REV ])
16     ].each do |sort|
17       assert_equal sort.to_s, Sort._load(sort._dump(0)).to_s
18     end
19   end
20
21 end
Note: See TracBrowser for help on using the browser.

To edit pages or tickets please login with username/password: aaf/aaf