mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
FatFS works (read-only, lightly tested).
This commit is contained in:
@@ -14,6 +14,7 @@ OBJS += $(OBJDIR)/tests/$1.o
|
||||
$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, LIBFLUXENGINE)
|
||||
$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, LIBARCH)
|
||||
$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, PROTO)
|
||||
$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, FATFS)
|
||||
|
||||
endef
|
||||
|
||||
|
||||
@@ -3,45 +3,52 @@
|
||||
#include "snowhouse/snowhouse.h"
|
||||
|
||||
using namespace snowhouse;
|
||||
|
||||
|
||||
static void testJoin()
|
||||
{
|
||||
AssertThat(join({}, "/"), Equals(""));
|
||||
AssertThat(join({"one"}, "/"), Equals("one"));
|
||||
AssertThat(join({"one", "two"}, "/"), Equals("one/two"));
|
||||
}
|
||||
|
||||
static void testLeftTrim()
|
||||
{
|
||||
AssertThat(leftTrimWhitespace("string"), Equals("string"));
|
||||
AssertThat(leftTrimWhitespace(" string"), Equals("string"));
|
||||
AssertThat(leftTrimWhitespace(" string "), Equals("string "));
|
||||
AssertThat(leftTrimWhitespace("string "), Equals("string "));
|
||||
AssertThat(leftTrimWhitespace("string"), Equals("string"));
|
||||
AssertThat(leftTrimWhitespace(" string"), Equals("string"));
|
||||
AssertThat(leftTrimWhitespace(" string "), Equals("string "));
|
||||
AssertThat(leftTrimWhitespace("string "), Equals("string "));
|
||||
}
|
||||
|
||||
static void testRightTrim()
|
||||
{
|
||||
AssertThat(rightTrimWhitespace("string"), Equals("string"));
|
||||
AssertThat(rightTrimWhitespace(" string"), Equals(" string"));
|
||||
AssertThat(rightTrimWhitespace(" string "), Equals(" string"));
|
||||
AssertThat(rightTrimWhitespace("string "), Equals("string"));
|
||||
AssertThat(rightTrimWhitespace("string"), Equals("string"));
|
||||
AssertThat(rightTrimWhitespace(" string"), Equals(" string"));
|
||||
AssertThat(rightTrimWhitespace(" string "), Equals(" string"));
|
||||
AssertThat(rightTrimWhitespace("string "), Equals("string"));
|
||||
}
|
||||
|
||||
static void testTrim()
|
||||
{
|
||||
AssertThat(trimWhitespace("string"), Equals("string"));
|
||||
AssertThat(trimWhitespace(" string"), Equals("string"));
|
||||
AssertThat(trimWhitespace(" string "), Equals("string"));
|
||||
AssertThat(trimWhitespace("string "), Equals("string"));
|
||||
AssertThat(trimWhitespace("string"), Equals("string"));
|
||||
AssertThat(trimWhitespace(" string"), Equals("string"));
|
||||
AssertThat(trimWhitespace(" string "), Equals("string"));
|
||||
AssertThat(trimWhitespace("string "), Equals("string"));
|
||||
}
|
||||
|
||||
static void testLeafname()
|
||||
{
|
||||
AssertThat(getLeafname(""), Equals(""));
|
||||
AssertThat(getLeafname("filename"), Equals("filename"));
|
||||
AssertThat(getLeafname("path/filename"), Equals("filename"));
|
||||
AssertThat(getLeafname("/path/path/filename"), Equals("filename"));
|
||||
AssertThat(getLeafname(""), Equals(""));
|
||||
AssertThat(getLeafname("filename"), Equals("filename"));
|
||||
AssertThat(getLeafname("path/filename"), Equals("filename"));
|
||||
AssertThat(getLeafname("/path/path/filename"), Equals("filename"));
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
testLeftTrim();
|
||||
testRightTrim();
|
||||
testTrim();
|
||||
testLeafname();
|
||||
return 0;
|
||||
testJoin();
|
||||
testLeftTrim();
|
||||
testRightTrim();
|
||||
testTrim();
|
||||
testLeafname();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user