<-- Previous || Up || Next -->

Strip Matching End Line Verify Sub
String Replacements Class

Private Sub StripMatchingEndLineVerify()
    'Test the StripMatchingEndLine function.

    Debug.Assert IsNull(StripMatchingEndLine(Null, "Abc")) ' Behavior #1

    Debug.Assert IsNull(StripMatchingEndLine("Abc", Null)) ' Behavior #2

    Debug.Assert StripMatchingEndLine("Abc", "") = "Abc" ' Behavior #3

    Debug.Assert StripMatchingEndLine("AbcDefAbc", "Abc", vbBinaryCompare) = "AbcDef" ' Behavior #4
    Debug.Assert StripMatchingEndLine("AbcDefAbc", "ABC", vbBinaryCompare) = "AbcDefAbc"
    Debug.Assert StripMatchingEndLine("AbcDefAbc", "Abc", vbTextCompare) = "AbcDef"
    Debug.Assert StripMatchingEndLine("AbcDefAbc", "ABC", vbTextCompare) = "AbcDef"

    Debug.Assert StripMatchingEndLine("AbcDefAbc", "Abc") = "AbcDef" ' Behavior #5
    Debug.Assert StripMatchingEndLine("AbcDefAbc", "ABC") = "AbcDefAbc"
    Debug.Assert StripMatchingEndLine("AbcDefAbc", "ABC", Null) = "AbcDefAbc"
    Debug.Assert StripMatchingEndLine("AbcDefAbc", "ABC", "Joe") = "AbcDefAbc"

    Debug.Assert StripMatchingEndLine("AbcDefGhi", "Abc") = "AbcDefGhi" ' General Behavior
    Debug.Assert StripMatchingEndLine("AbcDefGhi", "Def") = "AbcDefGhi"
    Debug.Assert StripMatchingEndLine("AbcDefGhi", "Ghi") = "AbcDef"

End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.