QMCPACK
test_FileUtility.cpp File Reference
+ Include dependency graph for test_FileUtility.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("FileUtility", "[xml]")
 

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "FileUtility"  ,
""  [xml] 
)

Definition at line 19 of file test_FileUtility.cpp.

References getExtension(), and qmcplusplus::REQUIRE().

20 {
21  std::string empty;
22  REQUIRE(getExtension(empty) == std::string_view());
23 
24  std::string no_extension("this_filename_has_no_extension");
25  REQUIRE(getExtension(no_extension) == std::string_view());
26 
27  std::string single_extension("filename.h5");
28  REQUIRE(getExtension(single_extension) == "h5");
29 
30  std::string multiple_extensions("filename.p001.h5");
31  REQUIRE(getExtension(multiple_extensions) == "h5");
32 }
REQUIRE(std::filesystem::exists(filename))
std::string_view getExtension(const std::string_view str)
Definition: FileUtility.h:19