Private Sub ReplaceStringVerify() 'Test the ReplaceString function. Debug.Assert IsNull(ReplaceString(Null, "cA", "-")) ' Behavior #1 Debug.Assert IsNull(ReplaceString("AbcAbcAbc", Null, "-")) ' Behavior #2 Debug.Assert ReplaceString("AbcAbcAbc", "", "-") = "AbcAbcAbc" ' Behavior #3 Debug.Assert ReplaceString("AbcAbcAbc", "cA") = "Abbbc" ' Behavior #4 Debug.Assert ReplaceString("AbcAbcAbc", "cA", Null) = "Abbbc" Debug.Assert ReplaceString("AbcAbcAbc", "cA", "") = "Abbbc" ' Behavior #5 Debug.Assert ReplaceString("AbcAbcAbc", "A", "AA") = "AAbcAAbcAAbc" ' Behavior #6 Debug.Assert ReplaceString("AbcAbcAbc", "Ab", "AbAb") = "AbAbcAbAbcAbAbc" Debug.Assert ReplaceString("AbcAbcAbc", "cA", "-", vbBinaryCompare) = "Ab-b-bc" ' Behavior #7 Debug.Assert ReplaceString("AbcAbcAbc", "ca", "-", vbBinaryCompare) = "AbcAbcAbc" Debug.Assert ReplaceString("AbcAbcAbc", "cA", "-", vbTextCompare) = "Ab-b-bc" Debug.Assert ReplaceString("AbcAbcAbc", "ca", "-", vbTextCompare) = "Ab-b-bc" Debug.Assert ReplaceString("AbcAbcAbc", "cA", "-") = "Ab-b-bc" ' Behavior #8 Debug.Assert ReplaceString("AbcAbcAbc", "ca", "-") = "AbcAbcAbc" Debug.Assert ReplaceString("AbcAbcAbc", "ca", "-", Null) = "AbcAbcAbc" Debug.Assert ReplaceString("AbcAbcAbc", "ca", "-", "Joe") = "AbcAbcAbc" End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.