mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fix io::path.parent() & update tests
This commit is contained in:
parent
a653b063e6
commit
e4c33e539e
3 changed files with 12 additions and 8 deletions
|
|
@ -3,10 +3,14 @@
|
|||
#include "coders/commons.hpp"
|
||||
#include "coders/lua_parsing.hpp"
|
||||
#include "io/io.hpp"
|
||||
#include "io/devices/StdfsDevice.hpp"
|
||||
#include "util/stringutil.hpp"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
TEST(lua_parsing, Tokenizer) {
|
||||
auto filename = "../../res/scripts/stdlib.lua";
|
||||
io::set_device("res", std::make_shared<io::StdfsDevice>(fs::u8path("../../res")));
|
||||
auto filename = "res:scripts/stdlib.lua";
|
||||
auto source = io::read_string(filename);
|
||||
try {
|
||||
auto tokens = lua::tokenize(filename, source);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,13 @@
|
|||
|
||||
#include "coders/vec3.hpp"
|
||||
#include "io/io.hpp"
|
||||
#include "io/devices/StdfsDevice.hpp"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
TEST(VEC3, Decode) {
|
||||
io::path file = "res/models/block.vec3";
|
||||
io::set_device("res", std::make_shared<io::StdfsDevice>(fs::u8path("../../res")));
|
||||
io::path file = "res:models/block.vec3";
|
||||
auto bytes = io::read_bytes_buffer(file);
|
||||
auto model = vec3::load(file.string(), bytes);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue