aboutsummaryrefslogtreecommitdiff
path: root/tests/ovsdb-data.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-02-08 15:37:49 -0800
committerBen Pfaff <blp@nicira.com>2010-02-08 15:37:49 -0800
commitbfe8e67ad595348f228938663956c3b8325997c5 (patch)
tree92280e0ad9fd035952d97ef6337fb8aa3fd936a0 /tests/ovsdb-data.at
parent0d0f05b909b6428d44eb147bd4edd73782d2a137 (diff)
ovsdb: Fix support for systems where libpcre is not installed.
This is one of the loose ends that I intended to fix up and test before pushing off my commits to add use of PCRE, but obviously I forgot.
Diffstat (limited to 'tests/ovsdb-data.at')
-rw-r--r--tests/ovsdb-data.at22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/ovsdb-data.at b/tests/ovsdb-data.at
index 03ec3b33..708ed905 100644
--- a/tests/ovsdb-data.at
+++ b/tests/ovsdb-data.at
@@ -290,8 +290,17 @@ constraint violation: -11 is not in the valid range -10 to 10 (inclusive)
constraint violation: 11 is not in the valid range -10 to 10 (inclusive)
constraint violation: 123576 is not in the valid range -10 to 10 (inclusive)])
-OVSDB_CHECK_POSITIVE([strings matching /(a(b)?)c?/],
- [[parse-atoms '{"type": "string", "reMatch": "(a(b)?)?c?"}' \
+AT_SETUP([strings matching /(a(b)?)c?/])
+AT_KEYWORDS([ovsdb positive])
+if test "$HAVE_PCRE" = yes; then
+ b_out='constraint violation: "b" does not match regular expression /(a(b)?)?c?/'
+ bc_out='constraint violation: "bc" does not match regular expression /(a(b)?)?c?/'
+else
+ b_out='"b"'
+ bc_out='"bc"'
+fi
+AT_CHECK_UNQUOTED(
+ [[test-ovsdb parse-atoms '{"type": "string", "reMatch": "(a(b)?)?c?"}' \
'[""]' \
'["a"]' \
'["ab"]' \
@@ -300,14 +309,17 @@ OVSDB_CHECK_POSITIVE([strings matching /(a(b)?)c?/],
'["b"]' \
'["bc"]' \
'["c"]']],
+ [0],
[[""
"a"
"ab"
"abc"
"ac"
-constraint violation: "b" does not match regular expression /(a(b)?)?c?/
-constraint violation: "bc" does not match regular expression /(a(b)?)?c?/
-"c"]])
+$b_out
+$bc_out
+"c"
+]])
+AT_CLEANUP
OVSDB_CHECK_POSITIVE([strings at least 2 characters long],
[[parse-atoms '{"type": "string", "minLength": 2}' \