summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2015-09-02 18:53:36 +0000
committerAndrew Stitcher <astitcher@apache.org>2015-09-02 18:53:36 +0000
commit27472cd394cfd173d29851d6d41749dcc2d0c5bd (patch)
tree8add73b3717900c6e6dd42def60288b8abd56f74
parent5ef2c7b6d1a55164943980a44586b132b94e62a1 (diff)
downloadqpid-python-27472cd394cfd173d29851d6d41749dcc2d0c5bd.tar.gz
QPID-6717: Unit tests to demonstrate the issue (or not!)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1700867 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/tests/Selector.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/Selector.cpp b/qpid/cpp/src/tests/Selector.cpp
index 73af1a9623..7d6dbf0010 100644
--- a/qpid/cpp/src/tests/Selector.cpp
+++ b/qpid/cpp/src/tests/Selector.cpp
@@ -419,8 +419,25 @@ QPID_AUTO_TEST_CASE(comparisonEval)
BOOST_CHECK(qb::Selector("'hello' IN ('hello', 'there', 1 , true, (1-17))").eval(env));
BOOST_CHECK(qb::Selector("TRUE IN ('hello', 'there', 1 , true, (1-17))").eval(env));
BOOST_CHECK(qb::Selector("-16 IN ('hello', 'there', 1 , true, (1-17))").eval(env));
+ BOOST_CHECK(!qb::Selector("1 IN ('hello', 'there', 'polly')").eval(env));
+ BOOST_CHECK(qb::Selector("1 NOT IN ('hello', 'there', 'polly')").eval(env));
BOOST_CHECK(!qb::Selector("'hell' IN ('hello', 'there', 1 , true, (1-17))").eval(env));
BOOST_CHECK(qb::Selector("('hell' IN ('hello', 'there', 1 , true, (1-17), A)) IS NULL").eval(env));
+ BOOST_CHECK(qb::Selector("('hell' NOT IN ('hello', 'there', 1 , true, (1-17), A)) IS NULL").eval(env));
+ BOOST_CHECK(!qb::Selector("'hello kitty' BETWEEN 30 and 40").eval(env));
+ BOOST_CHECK(qb::Selector("'hello kitty' NOT BETWEEN 30 and 40").eval(env));
+ BOOST_CHECK(!qb::Selector("14 BETWEEN 'aardvark' and 'zebra'").eval(env));
+ BOOST_CHECK(qb::Selector("14 NOT BETWEEN 'aardvark' and 'zebra'").eval(env));
+ BOOST_CHECK(!qb::Selector("TRUE BETWEEN 'aardvark' and 'zebra'").eval(env));
+ BOOST_CHECK(qb::Selector("TRUE NOT BETWEEN 'aardvark' and 'zebra'").eval(env));
+ BOOST_CHECK(qb::Selector("(A BETWEEN 'aardvark' and 14) IS NULL").eval(env));
+ BOOST_CHECK(qb::Selector("(A NOT BETWEEN 'aardvark' and 14) IS NULL").eval(env));
+ BOOST_CHECK(qb::Selector("(14 BETWEEN A and 17) IS NULL").eval(env));
+ BOOST_CHECK(qb::Selector("(14 NOT BETWEEN A and 17) IS NULL").eval(env));
+ BOOST_CHECK(qb::Selector("(14 BETWEEN 11 and A) IS NULL").eval(env));
+ BOOST_CHECK(qb::Selector("(14 NOT BETWEEN 11 and A) IS NULL").eval(env));
+ BOOST_CHECK(qb::Selector("14 NOT BETWEEN 11 and 9").eval(env));
+ BOOST_CHECK(qb::Selector("14 BETWEEN -11 and 54367").eval(env));
}
QPID_AUTO_TEST_CASE(NullEval)