isEqualTo
Short summary
This assertion method checks if the current string stringToCheck is equal to expected
Attention: All strings are handled as null terminated byte/word streams. For windows-1252 is end of the string 16#00 For UTF-16 is end of the string 16#00_00
Attention:
Method uses ANY_STRING and for this it's not possible
to use literals/constants, because for ANY types the
compiler generates__SYSTEM.AnyType and
__SYSTEM.AnyType contains a pointer
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| stringToCheck | ANY_STRING | current string to check | input |
| expected | ANY_STRING | stringToCheck must be equal to expected | input |
| message | AssertMessage | message if the assertion is false | input |
| ignoreCases | BOOL | TRUE means ignore cases; FALSE means cases must be equal too | input |
| normalizeStrings | BOOL | normalize both strings for check | input |
Code
Declaration
METHOD isEqualTo
VAR_INPUT
(* current string to check *)
stringToCheck :ANY_STRING;
(* ``stringToCheck`` must be equal to expected *)
expected :ANY_STRING;
(* message if the assertion is false *)
message :AssertMessage;
(* ``TRUE`` means ignore cases; ``FALSE`` means cases must be equal too *)
ignoreCases :BOOL := FALSE;
(*normalize both strings for check*)
normalizeStrings :BOOL := TRUE;
END_VAR