Brought over a bunch of code from the roguelike and now will use it to generate a random map.
This commit is contained in:
parent
8d3d3b4ec3
commit
2daa1c9bd5
59 changed files with 4303 additions and 411 deletions
39
tests/dbc.cpp
Normal file
39
tests/dbc.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include "dbc.hpp"
|
||||
|
||||
using namespace dbc;
|
||||
|
||||
TEST_CASE("basic feature tests", "[utils]") {
|
||||
log("Logging a message.");
|
||||
|
||||
try {
|
||||
sentinel("This shouldn't happen.");
|
||||
} catch(SentinelError) {
|
||||
log("Sentinel happened.");
|
||||
}
|
||||
|
||||
pre("confirm positive cases work", 1 == 1);
|
||||
pre("confirm positive lambda", [&]{ return 1 == 1;});
|
||||
post("confirm positive post", 1 == 1);
|
||||
post("confirm postitive post with lamdba", [&]{ return 1 == 1;});
|
||||
|
||||
check(1 == 1, "one equals 1");
|
||||
|
||||
try {
|
||||
check(1 == 2, "this should fail");
|
||||
} catch(CheckError err) {
|
||||
log("check fail worked");
|
||||
}
|
||||
|
||||
try {
|
||||
pre("failing pre", 1 == 3);
|
||||
} catch(PreCondError err) {
|
||||
log("pre fail worked");
|
||||
}
|
||||
|
||||
try {
|
||||
post("failing post", 1 == 4);
|
||||
} catch(PostCondError err) {
|
||||
log("post faile worked");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue