aboutsummaryrefslogtreecommitdiffstats
path: root/xt/lib/Bugzilla/Test/Search/Constants.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-15 23:26:06 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-15 23:26:06 -0700
commit2bd4ef390187c2d793d1167df4bc2424a3c66d80 (patch)
treeac6459ebf19c711445b511f26e8dfda49f5dfb71 /xt/lib/Bugzilla/Test/Search/Constants.pm
parentdbaf1c3aaf975ed78d8e8538b2df18ab9f47654b (diff)
downloadbugs-2bd4ef390187c2d793d1167df4bc2424a3c66d80.tar
bugs-2bd4ef390187c2d793d1167df4bc2424a3c66d80.tar.gz
bugs-2bd4ef390187c2d793d1167df4bc2424a3c66d80.tar.bz2
bugs-2bd4ef390187c2d793d1167df4bc2424a3c66d80.tar.xz
bugs-2bd4ef390187c2d793d1167df4bc2424a3c66d80.zip
Bug 579243: Also test NOT (negated) charts in xt/search.t
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'xt/lib/Bugzilla/Test/Search/Constants.pm')
-rw-r--r--xt/lib/Bugzilla/Test/Search/Constants.pm265
1 files changed, 265 insertions, 0 deletions
diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm
index 11a7760e2..b03ed30db 100644
--- a/xt/lib/Bugzilla/Test/Search/Constants.pm
+++ b/xt/lib/Bugzilla/Test/Search/Constants.pm
@@ -31,6 +31,7 @@ use Bugzilla::Constants;
our @EXPORT = qw(
ATTACHMENT_FIELDS
+ BROKEN_NOT
COLUMN_TRANSLATION
COMMENT_FIELDS
CUSTOM_FIELDS
@@ -494,6 +495,270 @@ use constant PG_BROKEN => {
},
};
+###################
+# Broken NotTests #
+###################
+
+# These are fields that are broken in the same way for pretty much every
+# NOT test that is broken.
+use constant COMMON_BROKEN_NOT => (
+ "attach_data.thedata" => { contains => [5] },
+ "attachments.description" => { contains => [5] },
+ "attachments.filename" => { contains => [5] },
+ "attachments.isobsolete" => { contains => [5] },
+ "attachments.ispatch" => { contains => [5] },
+ "attachments.isprivate" => { contains => [5] },
+ "attachments.mimetype" => { contains => [5] },
+ "attachments.submitter" => { contains => [5] },
+ "bug_file_loc" => { contains => [5] },
+ "deadline" => { contains => [5] },
+ "flagtypes.name" => { contains => [5] },
+ "keywords" => { contains => [5] },
+ "longdescs.isprivate" => { contains => [1] },
+ "percentage_complete" => { contains => [1 .. 5] },
+ "requestees.login_name" => { contains => [3, 4, 5] },
+ "see_also" => { contains => [5] },
+ "setters.login_name" => { contains => [5] },
+ FIELD_TYPE_BUG_ID, { contains => [5] },
+ FIELD_TYPE_DATETIME, { contains => [5] },
+ FIELD_TYPE_FREETEXT, { contains => [5] },
+ FIELD_TYPE_MULTI_SELECT, { contains => [1, 5] },
+ FIELD_TYPE_TEXTAREA, { contains => [5] },
+);
+
+# Common BROKEN_NOT values for the changed* fields.
+use constant CHANGED_BROKEN_NOT => (
+ "attach_data.thedata" => { contains => [1] },
+ "classification" => { contains => [1] },
+ "commenter" => { contains => [1] },
+ "delta_ts" => { contains => [1] },
+ "percentage_complete" => { contains => [1] },
+ "requestees.login_name" => { contains => [1] },
+ "setters.login_name" => { contains => [1] },
+ "work_time" => { contains => [1] },
+);
+
+# For changedfrom and changedto.
+use constant CHANGED_FROM_TO_BROKEN_NOT => (
+ "bug_group" => { contains => [1] },
+ "cc" => { contains => [1] },
+ "cf_multi_select" => { contains => [1] },
+ "estimated_time" => { contains => [1] },
+ "flagtypes.name" => { contains => [1] },
+ "keywords" => { contains => [1] },
+);
+
+# Common broken tests for the "not" or "no" operators.
+use constant NEGATIVE_BROKEN_NOT => (
+ "blocked" => { contains => [3, 4, 5] },
+ "bug_group" => { contains => [5] },
+ "cc" => { contains => [1, 5] },
+ "dependson" => { contains => [2, 4, 5] },
+ "flagtypes.name" => { contains => [1 .. 5] },
+ "percentage_complete" => { contains => [1 .. 5] },
+);
+
+# These are field/operator combinations that are broken when run under NOT().
+use constant BROKEN_NOT => {
+ allwords => {
+ COMMON_BROKEN_NOT,
+ "attach_data.thedata" => { contains => [1,5] },
+ bug_group => { contains => [1] },
+ cc => { contains => [1] },
+ "flagtypes.name" => { contains => [1,5] },
+ keywords => { contains => [1,5] },
+ longdesc => { contains => [1] },
+ 'see_also' => { },
+ work_time => { contains => [1] },
+ FIELD_TYPE_MULTI_SELECT, { },
+ },
+ 'allwords-<1> <2>' => {
+ 'attach_data.thedata' => { contains => [5] },
+ bug_group => { },
+ cc => { },
+ 'flagtypes.name' => { contains => [5] },
+ 'keywords' => { contains => [5] },
+ 'longdesc' => { },
+ 'longdescs.isprivate' => { },
+ work_time => { },
+ },
+ allwordssubstr => {
+ COMMON_BROKEN_NOT,
+ bug_group => { contains => [1] },
+ cc => { contains => [1] },
+ keywords => { contains => [1,5] },
+ longdesc => { contains => [1] },
+ see_also => { },
+ work_time => { contains => [1] },
+ FIELD_TYPE_MULTI_SELECT, { },
+ },
+ 'allwordssubstr-<1>,<2>' => {
+ bug_group => { },
+ "cc" => { },
+ FIELD_TYPE_MULTI_SELECT, { },
+ keywords => { contains => [5] },
+ "longdesc" => { },
+ "longdescs.isprivate" => { },
+ "see_also" => { },
+ "work_time" => { },
+ },
+ anyexact => {
+ COMMON_BROKEN_NOT,
+ "flagtypes.name" => { contains => [1, 2, 5] },
+ "longdesc" => { contains => [1, 2] },
+ "work_time" => { contains => [1, 2] }
+ },
+ 'anyexact-<1>, <2>' => {
+ bug_group => { contains => [1] },
+ percentage_complete => { contains => [1,3,4,5] },
+ keywords => { contains => [1,5] },
+ see_also => { },
+ FIELD_TYPE_MULTI_SELECT, { },
+ },
+ anywords => {
+ COMMON_BROKEN_NOT,
+ "attach_data.thedata" => { contains => [1, 5] },
+ "work_time" => { contains => [1, 2] },
+ "work_time" => { contains => [1] },
+ FIELD_TYPE_MULTI_SELECT, { contains => [5] },
+ },
+ 'anywords-<1> <2>' => {
+ 'attach_data.thedata' => { contains => [1,2,5] },
+ "percentage_complete" => { contains => [1,3,4,5] },
+ work_time => { contains => [1,2] },
+ },
+ anywordssubstr => {
+ COMMON_BROKEN_NOT,
+ "work_time" => { contains => [1, 2] },
+ },
+ 'anywordssubstr-<1> <2>' => {
+ percentage_complete => { contains => [1,3,4,5] },
+ FIELD_TYPE_MULTI_SELECT, { contains => [5] },
+ },
+ casesubstring => {
+ COMMON_BROKEN_NOT,
+ bug_group => { contains => [1] },
+ keywords => { contains => [1,5] },
+ longdesc => { contains => [1] },
+ work_time => { contains => [1] } ,
+ FIELD_TYPE_MULTI_SELECT, { contains => [1,5] },
+ },
+ 'casesubstring-<1>-lc' => {
+ bug_group => { },
+ keywords => { contains => [5] },
+ longdesc => { },
+ FIELD_TYPE_MULTI_SELECT, { contains => [5] },
+ },
+ changedafter => {
+ "attach_data.thedata" => { contains => [2, 3, 4] },
+ "classification" => { contains => [2, 3, 4] },
+ "commenter" => { contains => [2, 3, 4] },
+ "creation_ts" => { contains => [2, 3, 4] },
+ "delta_ts" => { contains => [2, 3, 4] },
+ "percentage_complete" => { contains => [2, 3, 4] },
+ "requestees.login_name" => { contains => [2, 3, 4] },
+ "setters.login_name" => { contains => [2, 3, 4] },
+ },
+ changedbefore=> {
+ CHANGED_BROKEN_NOT,
+ creation_ts => { contains => [1, 2, 5] },
+ work_time => { }
+ },
+ changedby => {
+ CHANGED_BROKEN_NOT,
+ creation_ts => { contains => [1] },
+ },
+ changedfrom => {
+ CHANGED_BROKEN_NOT,
+ CHANGED_FROM_TO_BROKEN_NOT,
+ 'attach_data.thedata' => { },
+ blocked => { contains => [1, 2] },
+ dependson => { contains => [1, 3] },
+ longdesc => { },
+ FIELD_TYPE_BUG_ID, { contains => [1 .. 4] },
+
+ },
+ changedto => {
+ CHANGED_BROKEN_NOT,
+ CHANGED_FROM_TO_BROKEN_NOT,
+ longdesc => { contains => [1] },
+ "remaining_time" => { contains => [1] },
+ },
+ equals => {
+ COMMON_BROKEN_NOT,
+ bug_group => { contains => [1] },
+ "flagtypes.name" => { contains => [1, 5] },
+ keywords => { contains => [1,5] },
+ longdesc => { contains => [1] },
+ work_time => { contains => [1] }
+ },
+ greaterthan => {
+ COMMON_BROKEN_NOT,
+ cc => { contains => [1] },
+ work_time => { contains => [2, 3, 4] },
+ FIELD_TYPE_MULTI_SELECT, { contains => [5] },
+ },
+ greaterthaneq => {
+ COMMON_BROKEN_NOT,
+ cc => { contains => [1] },
+ "flagtypes.name" => { contains => [2, 5] },
+ "work_time" => { contains => [2, 3, 4] },
+ percentage_complete => { contains => [1,3,4,5] },,
+ FIELD_TYPE_MULTI_SELECT, { contains => [5] },
+ },
+ lessthan => {
+ COMMON_BROKEN_NOT,
+ longdesc => { contains => [1] },
+ 'longdescs.isprivate' => { },
+ },
+ 'lessthan-2' => {
+ bug_group => { contains => [1] },
+ keywords => { contains => [1,5] },
+ },
+ lessthaneq => {
+ COMMON_BROKEN_NOT,
+ bug_group => { contains => [1] },
+ keywords => { contains => [1,5] },
+ longdesc => { contains => [1] },
+ 'longdescs.isprivate' => { },
+ },
+ notequals => { NEGATIVE_BROKEN_NOT },
+ notregexp => { NEGATIVE_BROKEN_NOT },
+ notsubstring => { NEGATIVE_BROKEN_NOT },
+ nowords => {
+ NEGATIVE_BROKEN_NOT,
+ "attach_data.thedata" => { contains => [1] },
+ "work_time" => { contains => [2, 3, 4] },
+ "cc" => { contains => [5] },
+ "flagtypes.name" => { },
+ },
+ nowordssubstr => {
+ NEGATIVE_BROKEN_NOT,
+ "attach_data.thedata" => { },
+ "cc" => { contains => [5] },
+ "flagtypes.name" => { },
+ "work_time" => { contains => [2, 3, 4] },
+ },
+ regexp => {
+ COMMON_BROKEN_NOT,
+ bug_group => { contains => [1] },
+ "flagtypes.name" => { contains => [1,5] },
+ keywords => { contains => [1,5] },
+ longdesc => { contains => [1] },
+ work_time => { contains => [1] },
+ },
+ 'regexp-^1-' => {
+ "flagtypes.name" => { contains => [5] },
+ },
+ substring => {
+ COMMON_BROKEN_NOT,
+ bug_group => { contains => [1] },
+ keywords => { contains => [1,5] },
+ longdesc => { contains => [1] },
+ work_time => { contains => [1] },
+ },
+};
+
#############
# Overrides #
#############