mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
33 lines
975 B
C++
33 lines
975 B
C++
#include "lib/globals.h"
|
|
#include "lib/vfs/vfs.h"
|
|
#include "snowhouse/snowhouse.h"
|
|
|
|
using namespace snowhouse;
|
|
|
|
static void testPathParsing()
|
|
{
|
|
AssertThat(Path(""), Equals(std::vector<std::string>{}));
|
|
AssertThat(Path("/"), Equals(std::vector<std::string>{}));
|
|
AssertThat(Path("one"), Equals(std::vector<std::string>{"one"}));
|
|
AssertThat(Path("one/two"), Equals(std::vector<std::string>{"one", "two"}));
|
|
AssertThat(
|
|
Path("/one/two"), Equals(std::vector<std::string>{"one", "two"}));
|
|
}
|
|
|
|
static void testPathParenthood()
|
|
{
|
|
AssertThat(Path("").parent(), Equals(std::vector<std::string>{}));
|
|
AssertThat(Path("one").parent(), Equals(std::vector<std::string>{}));
|
|
AssertThat(
|
|
Path("one/two").parent(), Equals(std::vector<std::string>{"one"}));
|
|
AssertThat(Path("one/two/three").parent(),
|
|
Equals(std::vector<std::string>{"one", "two"}));
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
testPathParsing();
|
|
testPathParenthood();
|
|
return 0;
|
|
}
|