26 lines
532 B
C++
26 lines
532 B
C++
|
#include <cruft/util/tap.hpp>
|
||
|
#include <cruft/util/fs/scoped.hpp>
|
||
|
#include <cruft/util/fs/tmp.hpp>
|
||
|
|
||
|
|
||
|
int
|
||
|
main (int, char**)
|
||
|
{
|
||
|
cruft::TAP::logger tap;
|
||
|
|
||
|
{
|
||
|
bool success = true;
|
||
|
auto const path = cruft::fs::mktmpdir ();
|
||
|
|
||
|
{
|
||
|
cruft::fs::scoped_dir dir (path);
|
||
|
success = success && std::filesystem::is_directory (path);
|
||
|
}
|
||
|
|
||
|
success = success && !exists(path);
|
||
|
|
||
|
tap.expect (success, "scoped_dir removes directory after scope");
|
||
|
}
|
||
|
|
||
|
return tap.status ();
|
||
|
}
|