package jalview.util;
import java.io.File;
+import java.io.IOException;
import java.util.List;
import org.testng.Assert;
else if (where < 0)
Assert.assertTrue(d.startsWith(dirname),
"getDirname(" + file.getPath() + ")=" + d
- + " didn't start with '" + d + "'");
+ + " didn't start with '" + dirname + "'");
else if (where > 0)
Assert.assertTrue(d.endsWith(dirname), "getDirname(" + file.getPath()
+ ")=" + d + " didn't end with '" + d + "'");
@DataProvider(name = "dirnamesAndBasenames")
public Object[][] dirnamesAndBasenames()
{
+ String homeDir = null;
+ try
+ {
+ homeDir = new File(System.getProperty("user.home"))
+ .getCanonicalPath();
+ } catch (IOException e)
+ {
+ System.err.println("Problem getting canonical home dir");
+ e.printStackTrace();
+ }
return new Object[][] { // -1=startsWith, 0=equals, 1=endsWith
- { "~/hello/sailor", -1, System.getProperty("user.home"), "sailor",
- "~" }, //
+ { "~/hello/sailor", -1, homeDir, "sailor", "~" }, //
{ "~/hello/sailor", 1, "/hello", "sailor", "~" }, //
{ "./examples/uniref50.fa", -1, "/", "uniref50", null }, //
{ "./examples/uniref50.fa", 1, "/examples", "uniref50", null }, //