]> git.saurik.com Git - apt.git/blobdiff - test/libapt/fileutl_test.cc
adapt to the new CacheSetHelper API
[apt.git] / test / libapt / fileutl_test.cc
index c2a43eda7d1db6a395242c1e587e6c96d0578a8b..cdf7ea479a75bf276ce3f58237c4fa859d464b30 100644 (file)
@@ -224,7 +224,6 @@ TEST(FileUtlTest, GetTempDir)
    if (old_tmpdir.empty() == false)
       setenv("TMPDIR", old_tmpdir.c_str(), 1);
 }
-
 TEST(FileUtlTest, Popen)
 {
    FileFd Fd;
@@ -272,3 +271,14 @@ TEST(FileUtlTest, Popen)
    Fd.Close();
    ExecWait(Child, "PopenWrite");
 }
+TEST(FileUtlTest, flAbsPath)
+{
+   std::string cwd = SafeGetCWD();
+   int res = chdir("/bin/");
+   EXPECT_EQ(res, 0);
+   std::string p = flAbsPath("ls");
+   EXPECT_EQ(p, "/bin/ls");
+
+   res = chdir(cwd.c_str());
+   EXPECT_EQ(res, 0);
+}