Test Cases - Enabling fuzzy verification
User's Guide
119
5 D
ESIGNING
AND
R
ECORDING
T
ESTCASES
Recording the verification stage
To work around this problem, you can use fuzzy verification, where the rules
for when two strings match are loosened. Using fuzzy verification, the
expected and actual values do not have to exactly match. The two values are
considered to match when one of them is the same as the first or last part of
the other one. Specifically, VerifyProperties with fuzzy verification will pass
whenever any of the following functions would return TRUE (where actual is
the actual value and expected is the expected value):
·
MatchStr (actual + "*", expected)
·
MatchStr ("*" + actual, expected)
·
MatchStr (actual, expected + "*")
·
MatchStr (actual, "*" + expected)
(In string comparisons, * stands for any zero or more characters.)
For example, all the following would pass if fuzzy verification is enabled:
Enabling fuzzy verification You enable fuzzy verification by using an
optional second argument to VerifyProperties, which has this prototype:
VerifyProperties (WINPROPTREE WinPropTree [, FUZZYVERIFY
FuzzyVerifyWhich])
where the
FUZZYVERIFY
data type is defined as:
type FUZZYVERIFY is BOOLEAN, DATACLASS, LIST OF
DATACLASS
So, for the optional FuzzyVerifyWhich argument you can either specify TRUE
or FALSE, one class name, or a list of class names.
Actual value
Expected value
29 Pagoda
29 Pagoda Street
oda Street
29 Pagoda Street
29 Pagoda Street
29 Pagoda
29 Pagoda Street
oda Street
FuzzyVerifyWhich
value
Result
FALSE (default)
Fuzzy verification is disabled.