migrate from std::filesystem::path to io::path (WIP)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
TEST(lua_parsing, Tokenizer) {
|
||||
auto filename = "../../res/scripts/stdlib.lua";
|
||||
auto source = io::read_string(std::filesystem::u8path(filename));
|
||||
auto source = io::read_string(filename);
|
||||
try {
|
||||
auto tokens = lua::tokenize(filename, source);
|
||||
for (const auto& token : tokens) {
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include "io/io.hpp"
|
||||
|
||||
TEST(VEC3, Decode) {
|
||||
auto file = std::filesystem::u8path(
|
||||
"res/models/block.vec3"
|
||||
);
|
||||
io::path file = "res/models/block.vec3";
|
||||
auto bytes = io::read_bytes_buffer(file);
|
||||
auto model = vec3::load(file.u8string(), bytes);
|
||||
auto model = vec3::load(file.string(), bytes);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "io/path.hpp"
|
||||
|
||||
TEST(Path, Path) {
|
||||
io::path p("entry_point:path/file.ext");
|
||||
EXPECT_EQ(p, "entry_point:path/file.ext");
|
||||
EXPECT_EQ(p.pathPart(), "path/file.ext");
|
||||
EXPECT_EQ(p.name(), "file.ext");
|
||||
EXPECT_EQ(p.extension(), ".ext");
|
||||
EXPECT_EQ(p.entryPoint(), "entry_point");
|
||||
EXPECT_EQ(p / "child", "entry_point:path/file.ext/child");
|
||||
EXPECT_EQ(p.parent(), "entry_point:path");
|
||||
}
|
||||
Reference in New Issue
Block a user