libcruft-util/test/fs/tmp.cpp

21 lines
512 B
C++

#include <cruft/util/tap.hpp>
#include <cruft/util/fs/tmp.hpp>
#include <cruft/util/fs/scoped.hpp>
#include <filesystem>
int main (int, char **)
{
cruft::TAP::logger tap;
{
cruft::fs::scoped_dir dir (cruft::fs::mktmpdir ());
tap.expect (std::filesystem::is_directory (*dir), "tmpdir is a directory");
auto const tmpfile = cruft::fs::mktempfile (*dir);
tap.expect (std::filesystem::is_regular_file (tmpfile), "mktempfile is a file");
}
return tap.status ();
}