21#include "gdbsupport/pathstuff.h"
22#include "gdbsupport/selftest.h"
27template <
typename ...Args>
31 std::string actual = ::path_join (paths...);
33 SELF_CHECK (actual == expected);
41 test_one (
"/foo/bar",
"/foo",
"bar");
43 test_one (
"foo/bar/",
"foo",
"bar",
"");
45 test_one (
"foo/bar",
"foo",
"",
"bar");
49 test_one (
"D:/foo/bar",
"D:/foo",
"bar");
50 test_one (
"D:/foo/bar",
"D:/foo/",
"bar");
57 test_one (
"D:\\foo/bar",
"D:\\foo",
"bar");
58 test_one (
"D:\\foo\\bar",
"D:\\foo\\",
"bar");
59 test_one (
"\\\\server\\dir\\file",
"\\\\server\\dir\\",
"file");
60 test_one (
"\\\\server\\dir/file",
"\\\\server\\dir",
"file");
71 selftests::register_test (
"path_join",
static void test_one(const char *expected, Args... paths)
void _initialize_path_join_selftests()