Matrix now just does the dumping but I need to make this more formal I think.

This commit is contained in:
Zed A. Shaw 2024-12-05 09:17:30 -05:00
parent eb0ca38e30
commit 56b26e1c4a
9 changed files with 44 additions and 33 deletions

View file

@ -14,8 +14,8 @@
"expected": [
[1, 1, 1, 0],
[1, 0, 1, 1],
[1, 0, 10, 2],
[1, 1, 10, 3]
[1, 0, 1000, 2],
[1, 1, 1000, 3]
]
},{
"input": [
@ -33,7 +33,7 @@
"expected": [
[1, 1, 1, 0],
[1, 0, 1, 1],
[1, 0, 16, 2],
[1, 1, 16, 3]
[1, 0, 1000, 2],
[1, 1, 1000, 3]
]
}]

View file

@ -48,8 +48,8 @@ TEST_CASE("dijkstra algo test", "[map]") {
if(paths != expected) {
println("ERROR! ------");
dump_map("EXPECTED", expected);
dump_map("RESULT", paths);
matrix_dump("EXPECTED", expected);
matrix_dump("RESULT", paths);
}
REQUIRE(map.INVARIANT());

View file

@ -3,7 +3,7 @@
#include <nlohmann/json.hpp>
#include <fstream>
#include "pathing.hpp"
#include "map.hpp"
#include "matrix.hpp"
using namespace fmt;
using namespace nlohmann;
@ -30,6 +30,8 @@ TEST_CASE("dijkstra algo test", "[pathing]") {
REQUIRE(pathing.INVARIANT());
// REQUIRE(pathing.$paths == expected);
matrix_dump("PATHING RESULT", pathing.$paths);
matrix_dump("PATHING EXPECTED", expected);
REQUIRE(pathing.$paths == expected);
}
}

View file

@ -20,7 +20,7 @@ TEST_CASE("dumping and debugging", "[builder]") {
WorldBuilder builder(map);
builder.generate();
dump_map("GENERATED", map.paths());
matrix_dump("GENERATED", map.paths());
map.dump();
}