Private Sub ReplaceStringOnceVerify() 'Test the ReplaceStringOnce function. Debug.Assert IsNull(ReplaceStringOnce(Null, "cA", "-")) ' Behavior #1 Debug.Assert IsNull(ReplaceStringOnce("AbcAbcAbc", Null, "-")) ' Behavior #2 Debug.Assert ReplaceStringOnce("AbcAbcAbc", "", "-") = "AbcAbcAbc" ' Behavior #3 Debug.Assert ReplaceStringOnce("AbcAbcAbc", "cA") = "AbbcAbc" ' Behavior #4 Debug.Assert ReplaceStringOnce("AbcAbcAbc", "cA", Null) = "AbbcAbc" Debug.Assert ReplaceStringOnce("AbcAbcAbc", "cA", "") = "AbbcAbc" ' Behavior #5 Debug.Assert ReplaceStringOnce("AbcAbcAbc", "cA", "-", vbBinaryCompare) = "Ab-bcAbc" ' Behavior #6 Debug.Assert ReplaceStringOnce("AbcAbcAbc", "ca", "-", vbBinaryCompare) = "AbcAbcAbc" Debug.Assert ReplaceStringOnce("AbcAbcAbc", "cA", "-", vbTextCompare) = "Ab-bcAbc" Debug.Assert ReplaceStringOnce("AbcAbcAbc", "ca", "-", vbTextCompare) = "Ab-bcAbc" Debug.Assert ReplaceStringOnce("AbcAbcAbc", "cA", "-") = "Ab-bcAbc" ' Behavior #7 Debug.Assert ReplaceStringOnce("AbcAbcAbc", "ca", "-") = "AbcAbcAbc" Debug.Assert ReplaceStringOnce("AbcAbcAbc", "ca", "-", Null) = "AbcAbcAbc" Debug.Assert ReplaceStringOnce("AbcAbcAbc", "ca", "-", "Joe") = "AbcAbcAbc" End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.