DFS and Brother120 can now list files (more or less).

This commit is contained in:
David Given
2022-08-24 23:31:17 +02:00
parent 0e719c2b86
commit 0e157af8d9
14 changed files with 408 additions and 22 deletions

View File

@@ -32,6 +32,7 @@ $(call declare-test,kryoflux)
$(call declare-test,ldbs)
$(call declare-test,proto)
$(call declare-test,utils)
$(call declare-test,vfs)
$(call use-library, $(OBJDIR)/tests/agg.exe, $(OBJDIR)/tests/agg.o, AGG)
$(call use-library, $(OBJDIR)/tests/agg.exe, $(OBJDIR)/tests/agg.o, STB)

22
tests/vfs.cc Normal file
View File

@@ -0,0 +1,22 @@
#include "globals.h"
#include "lib/vfs/vfs.h"
#include "snowhouse/snowhouse.h"
using namespace snowhouse;
static void testPathParsing()
{
AssertThat(parsePath(""), Equals(std::vector<std::string>{}));
AssertThat(parsePath("/"), Equals(std::vector<std::string>{}));
AssertThat(parsePath("one"), Equals(std::vector<std::string>{ "one" }));
AssertThat(parsePath("one/two"), Equals(std::vector<std::string>{ "one", "two" }));
AssertThat(parsePath("/one/two"), Equals(std::vector<std::string>{ "one", "two" }));
}
int main(void)
{
testPathParsing();
return 0;
}