mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 15:02:01 -04:00
Move duplicated utilities to the common util folder and remove NEXT_DIR (#29)
* move things to the common library and remove next_dir * fix for windows * one last windows fix * last fix for real this time * debug listener test * fix listener threading bug
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "goalc/goos/Reader.h"
|
||||
#include "goalc/util/file_io.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
|
||||
using namespace goos;
|
||||
|
||||
@@ -316,16 +316,16 @@ TEST(GoosReader, TopLevel) {
|
||||
|
||||
TEST(GoosReader, FromFile) {
|
||||
Reader reader;
|
||||
auto result = reader.read_from_file(util::combine_path({"test", "test_reader_file0.gc"})).print();
|
||||
auto result = reader.read_from_file({"test", "test_reader_file0.gc"}).print();
|
||||
EXPECT_TRUE(result == "(top-level (1 2 3 4))");
|
||||
}
|
||||
|
||||
TEST(GoosReader, TextDb) {
|
||||
// very specific to this particular test file, but whatever.
|
||||
Reader reader;
|
||||
auto file_path = util::combine_path({"test", "test_reader_file0.gc"});
|
||||
auto result = reader.read_from_file(file_path).as_pair()->cdr.as_pair()->car;
|
||||
std::string expected = "text from " + util::combine_path(reader.get_source_dir(), file_path) +
|
||||
auto result =
|
||||
reader.read_from_file({"test", "test_reader_file0.gc"}).as_pair()->cdr.as_pair()->car;
|
||||
std::string expected = "text from " + file_util::get_file_path({"test", "test_reader_file0.gc"}) +
|
||||
", line: 5\n(1 2 3 4)\n";
|
||||
EXPECT_EQ(expected, reader.db.get_info_for(result));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user