summaryrefslogtreecommitdiff
path: root/test/libapt/fileutl_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/libapt/fileutl_test.cc')
-rw-r--r--test/libapt/fileutl_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index b6b8ac579..462bdefd9 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -38,5 +38,18 @@ int main(int argc,char *argv[])
return 1;
}
+ // GetTempDir()
+ unsetenv("TMPDIR");
+ equals(GetTempDir(), "/tmp");
+
+ setenv("TMPDIR", "", 1);
+ equals(GetTempDir(), "/tmp");
+
+ setenv("TMPDIR", "/not-there-no-really-not", 1);
+ equals(GetTempDir(), "/tmp");
+
+ setenv("TMPDIR", "/usr", 1);
+ equals(GetTempDir(), "/usr");
+
return 0;
}