aboutsummaryrefslogtreecommitdiffstats
path: root/xt/lib/Bugzilla/Test/Search.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-05-16 20:12:51 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-05-16 20:12:51 -0700
commitcca5b123ae93a811b335815b0f754c4e4f44c8d4 (patch)
tree2a717c53176c162a8b4c0734ad55ab24083e219f /xt/lib/Bugzilla/Test/Search.pm
parenta8c38773194820956e91b18735beb59e50a2686c (diff)
downloadbugs-cca5b123ae93a811b335815b0f754c4e4f44c8d4.tar
bugs-cca5b123ae93a811b335815b0f754c4e4f44c8d4.tar.gz
bugs-cca5b123ae93a811b335815b0f754c4e4f44c8d4.tar.bz2
bugs-cca5b123ae93a811b335815b0f754c4e4f44c8d4.tar.xz
bugs-cca5b123ae93a811b335815b0f754c4e4f44c8d4.zip
Bug 657542: Make the AND/OR tests for xt/search.t function properly and
catch known-broken tests as it's supposed to. r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'xt/lib/Bugzilla/Test/Search.pm')
-rw-r--r--xt/lib/Bugzilla/Test/Search.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/xt/lib/Bugzilla/Test/Search.pm b/xt/lib/Bugzilla/Test/Search.pm
index 133996283..f18d3e4ca 100644
--- a/xt/lib/Bugzilla/Test/Search.pm
+++ b/xt/lib/Bugzilla/Test/Search.pm
@@ -851,6 +851,20 @@ sub value_translation_cache {
return $self->{value_translation_cache}->{$test_name};
}
+# When doing AND/OR tests, the value for transformed_value_was_equal
+# (see Bugzilla::Test::Search::FieldTest) won't be recalculated
+# if we pull our values from the value_translation_cache. So we need
+# to also cache the values for transformed_value_was_equal.
+sub was_equal_cache {
+ my ($self, $field_test, $number, $value) = @_;
+ return if !$self->option('long');
+ my $test_name = $field_test->name;
+ if (@_ == 4) {
+ $self->{tvwe_cache}->{$test_name}->{$number} = $value;
+ }
+ return $self->{tvwe_cache}->{$test_name}->{$number};
+}
+
#############
# Main Test #
#############