]>
git.saurik.com Git - apt.git/blob - test/libapt/fileutl_test.cc
1 #include <apt-pkg/error.h>
2 #include <apt-pkg/fileutl.h>
13 int main(int argc
,char *argv
[])
15 std::vector
<std::string
> files
;
18 files
= Glob("*.lst");
19 if (files
.size() != 1)
26 files
= Glob("xxxyyyzzz");
27 if (files
.size() != 0 || _error
->PendingError())
33 // many matches (number is a bit random)
35 if (files
.size() < 10)
43 equals(GetTempDir(), "/tmp");
45 setenv("TMPDIR", "", 1);
46 equals(GetTempDir(), "/tmp");
48 setenv("TMPDIR", "/not-there-no-really-not", 1);
49 equals(GetTempDir(), "/tmp");
51 setenv("TMPDIR", "/usr", 1);
52 equals(GetTempDir(), "/usr");