MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test

Function test

tests/basic/test-filename.cpp:31–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#include <geode/tests/common.hpp>
30
31void test()
32{
33 std::string path1 = "/where/is/file.ext";
34 geode::OpenGeodeBasicException::test(
35 geode::filename_with_extension( path1 ) == "file.ext",
36 "Wrong result for path1 with extension" );
37 geode::OpenGeodeBasicException::test(
38 geode::filename_without_extension( path1 ) == "file",
39 "Wrong result for path1 without extension" );
40
41 std::string path2 = "file.ext";
42 geode::OpenGeodeBasicException::test(
43 geode::filename_with_extension( path2 ) == "file.ext",
44 "Wrong result for path2 with extension" );
45 geode::OpenGeodeBasicException::test(
46 geode::filename_without_extension( path2 ) == "file",
47 "Wrong result for path2 without extension" );
48 geode::OpenGeodeBasicException::test(
49 geode::filepath_without_extension( path2 ) == "file",
50 "Wrong result for filepath2 without extension" );
51 geode::OpenGeodeBasicException::test(
52 geode::filepath_without_filename( path2 ) == "",
53 "Wrong result for filepath2 without file name" );
54
55 std::string path3 = "C:/where/is/file.ext";
56 geode::OpenGeodeBasicException::test(
57 geode::filename_with_extension( path3 ) == "file.ext",
58 "Wrong result for path3 with extension" );
59 geode::OpenGeodeBasicException::test(
60 geode::filename_without_extension( path3 ) == "file",
61 "Wrong result for path3 without extension" );
62}
63
64OPENGEODE_TEST( "filename" )

Callers

nothing calls this directly

Calls 4

filename_with_extensionFunction · 0.85

Tested by

no test coverage detected