From dbca44e6b79333fd4778381782eb825d66320a3c Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Tue, 11 Sep 2007 09:33:42 +0000
Subject: [PATCH] add case insensitive mode for checkMatches
---
opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
index 01a84e8..939eb61 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
@@ -1126,6 +1126,12 @@
</function-arg-description>
<function-arg-property name="type" value="string"/>
</function-arg-def>
+ <function-arg-def name="caseSensitive" type="optional" default="'true'">
+ <function-arg-description>
+ comparison using case sensitive, or not value is : true/false
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
<function-arg-def name="nbExpected" type="optional" default="1">
<function-arg-description>
number of expected sub-string that must be in the main string
@@ -1136,12 +1142,19 @@
<sequence>
<script>
+ caseSensitiveInfo = '[case sensitive mode]'
+
+ if caseSensitive == 'false':
+ string2find = string2find.lower()
+ mainString = mainString.lower()
+ caseSensitiveInfo = '[case insensitive mode]'
+
nbFound = mainString.count(string2find)
if nbFound == nbExpected:
- myMessage = 'SUCCESS : %s matches %s time(s) (expected %s)' % (string2find,nbFound,nbExpected)
+ myMessage = 'SUCCESS : %s matches %s time(s) (expected %s) %s' % (string2find,nbFound,nbExpected,caseSensitiveInfo)
myRC=0
else:
- myMessage = 'ERROR : %s matches %s time(s) (expected %s) in "%s"' % (string2find,nbFound,nbExpected,mainString)
+ myMessage = 'ERROR : %s matches %s time(s) (expected %s) in "%s" %s' % (string2find,nbFound,nbExpected,mainString,caseSensitiveInfo)
myRC=1
</script>
<if expr="myRC == 0">
--
Gitblit v1.10.0