Public Function IsGoodGetPath() As Boolean
' verify correct GetPath returns
' returns True if all tests are passed
  
  ' replace "GetPath04" with the name of your function to test
  Dim fFailed As Boolean
  
  If GetPath04("c:\dir") <> "c:\" Then Stop: fFailed = True
  If GetPath04("c:\file.txt") <> "c:\" Then Stop: fFailed = True
  If GetPath04("") <> "" Then Stop: fFailed = True
 
  ' FSO -> ""
  If GetPath04("c:") <> "c:" Then Stop: fFailed = True
  
  ' FSO -> "c:\dir"
  If GetPath04("c:\dir\file.txt") <> "c:\dir\" Then Stop: fFailed = True
  
  ' FSO -> "c:\"
  If GetPath04("c:\dir\") <> "c:\dir\" Then Stop: fFailed = True
  
  ' FSO -> ""
  If GetPath04("noslash") <> "noslash" Then Stop: fFailed = True
 
  ' well done
  IsGoodGetPath = Not fFailed
  
End Function


Back to GetPath