LibreWeb-Browser/tst/file_test.cc

16 lines
367 B
C++
Raw Normal View History

2022-01-27 14:25:48 -08:00
#include "file.h"
#include "gtest/gtest.h"
#include <string>
namespace
{
TEST(LibreWebTest, TestGetFilename)
{
// Given
std::string path = "/path/to/a/filename.sh";
2022-05-25 15:14:18 -07:00
std::string expected_filename = "filename.sh";
2022-01-27 14:25:48 -08:00
// When
2022-05-25 15:14:18 -07:00
std::string filename = File::get_filename(path);
2022-01-27 14:25:48 -08:00
// Then
2022-05-25 15:14:18 -07:00
ASSERT_EQ(filename, expected_filename);
2022-01-27 14:25:48 -08:00
}
} // namespace