Description: Tests for the "sort" parameter in SEARCH. [[%SCRIPTURL{"view"}%/%WEB%/%TOPIC%?test=compare&debugenableplugins=TestFixturePlugin&skin=pattern][run this test]] Designed by: Lynnwood Brown Topics created for test (Text Item; Number Item; Created; Modified): * SearchTestTopic1 (Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56) * SearchTestTopic2 (Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23) * SearchTestTopic3 (Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59) format="!$topic; Text Item; Number Item; created date; modified date" ---++ Test searches ---+++ Search ordered by Topic Name _This search should be ordered by sequence of values in "Topic Name" field._ %BR% ---++++ Expected <!-- expected rex SORT BY TOPIC NAME --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="topic" }% <!-- /actual --> ---+++ Search ordered by Topic Name, reversed _This search should be ordered by *reversed* sequence of values in "Topic Name" field._ %BR% ---++++ Expected <!-- expected rex SORT BY REV TOPIC NAME --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="topic" reverse="on" }% <!-- /actual --> ---+++ Search ordered by Topic Name, limited to 2 _This search should be ordered by sequence of values in "Topic Name" field._ %BR% ---++++ Expected <!-- expected rex SORT BY TOPIC NAME LIMITED TO 2 --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="topic" limit="2"}% <!-- /actual --> ---+++ Search ordered by Topic Name, reversed, limited to 2 _This search should be ordered by *reversed* sequence of values in "Topic Name" field._ %BR% ---++++ Expected <!-- expected rex SORT BY REV TOPIC NAME LIMITED TO 2 --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="topic" reverse="on" limit="2"}% <!-- /actual --> ---+++ Search ordered by "Text Item" formfield _This search should be ordered by sequence of values in "Text Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY TEXT ITEM --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Text Item)" reverse="0" }% <!-- /actual --> ---+++ Search ordered by "Text Item" formfield, reversed _This search should be ordered by *reversed* sequence of values in "Text Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY REV TEXT ITEM --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Text Item)" reverse="on" }% <!-- /actual --> <!-- yes, reverse="off". That's what search does, it interprets "off" as "on" --> ---+++ Search ordered by "Text Item" formfield, limited to 2 _This search should be ordered by sequence of values in "Text Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY TEXT ITEM LIMITED TO 2 --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Text Item)" reverse="0" limit="2"}% <!-- /actual --> ---+++ Search ordered by "Text Item" formfield, reversed, limited to 2 _This search should be ordered by *reversed* sequence of values in "Text Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY REV TEXT ITEM LIMITED TO 2 --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Text Item)" reverse="on" limit="2"}% <!-- /actual --> <!-- yes, reverse="off". That's what search does, it interprets "off" as "on" --> ---+++ Search ordered by "Number Item" formfield _This search should be ordered by sequence of values in "Number Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY NUMBER ITEM --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Number Item)" }% <!-- /actual --> ---+++ Search ordered by "Number Item" formfield, reversed _This search should be ordered by *reversed* sequence of values in "Number Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY REV NUMBER ITEM --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Number Item)" reverse="1"}% <!-- /actual --> ---+++ Search sorted by "Number Item" formfield, limited to 2 _This search should be sorted by sequence of values in "Number Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY NUMBER ITEM LIMITED TO 2 --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Number Item)" limit="2" }% <!-- /actual --> ---+++ Search sorted by "Number Item" formfield, reversed, limited to 2 _This search should be sorted by *reversed* sequence of values in "Number Item" field._ %BR% ---++++ Expected <!-- expected rex SORT BY REV NUMBER ITEM LIMITED TO 2 --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="formfield(Number Item)" reverse="1" limit="2"}% <!-- /actual --> ---+++ Search sorted by date modified _This search should be sorted in sequence of values in "Modified" field (newest first)._ %BR% ---++++ Expected <!-- expected rex SORT BY DATE MODIFIED --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="modified" reverse="" }% <!-- /actual --> ---+++ Search sorted by date modified, reversed _This search should be sorted in sequence of values in "Modified" field (oldest recently modified first)._ %BR% ---++++ Expected <!-- expected rex SORT BY REV DATE MODIFIED --> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="modified" reverse="on" }% <!-- /actual --> ---+++ Search sorted by date modified, limited to 2 _This search should be sorted in sequence of values in "Modified" field (newest first)._ %BR% ---++++ Expected <!-- expected rex SORT BY DATE MODIFIED LIMITED TO 2 --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="modified" reverse="" limit="2"}% <!-- /actual --> ---+++ Search sorted by date modified, reversed, limited to 2 _This search should be sorted in sequence of values in "Modified" field (oldest recently modified first)._ %BR% ---++++ Expected <!-- expected rex SORT BY REV DATE MODIFIED LIMITED TO 2 --> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="modified" reverse="on" limit="2"}% <!-- /actual --> ---+++ Search sorted by date created <!-- expected rex SORT BY DATE CREATED --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="created" }% <!-- /actual --> ---+++ Search sorted by date created, reversed <!-- expected rex SORT BY REV DATE CREATED --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="created" reverse="on"}% <!-- /actual --> ---+++ Search sorted by date created, limited to 2 <!-- expected rex SORT BY DATE CREATED LIMITED TO 2 --> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="created" limit="2"}% <!-- /actual --> ---+++ Search sorted by date created, reversed, limited to 2 <!-- expected rex SORT BY REV DATE CREATED LIMITED TO 2 --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59<br /> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date<br />" sort="created" reverse="on" limit="2"}% <!-- /actual --> ---+++ Search sorted by editby, limited to 2 <!-- expected rex SORT BY DATE CREATED LIMITED TO 2 --> SearchTestTopic2; Value_2; 2; 2005-12-14 - 21:58; 2005-12-14 - 22:23; <nop>AnnaAncher<br /> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56; <nop>KennethLavrsen<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date; <nop>$wikiname<br />" sort="editby" limit="2"}% <!-- /actual --> ---+++ Search sorted by editby, reversed, limited to 2 <!-- expected rex SORT BY REV DATE CREATED LIMITED TO 2 --> SearchTestTopic3; Value_3; 1; 2005-12-14 - 21:59; 2005-12-14 - 21:59; <nop>MichaelAncher<br /> SearchTestTopic1; Value_1; 3; 2005-12-14 - 21:56; 2005-12-14 - 21:56; <nop>KennethLavrsen<br /> <!-- /expected --> ---++++ Actual <!-- actual --> %SEARCH{ "SearchTestTopic" scope="topic" scope="topic" nototal="on" nosearch="on" header="" format="!$topic; $formfield(Text Item); $formfield(Number Item); $createdate; $date; <nop>$wikiname<br />" sort="editby" reverse="on" limit="2"}% <!-- /actual -->
This topic: TestCases
>
TestCaseAutoSearchSort
Topic revision: r0 - 2012-11-09 - TWikiContributor
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback