Files
taskwarrior-2.x/binding-tests/replica.cpp
Dustin J. Mitchell e590dc7c98 add tc_replica_undo
2022-01-25 02:26:04 +00:00

19 lines
511 B
C++

#include <string.h>
#include "doctest.h"
#include "taskchampion.h"
TEST_CASE("creating an in-memory Replica does not crash") {
Replica *rep = tc_replica_new(NULL);
CHECK(tc_replica_error(rep) == NULL);
tc_replica_free(rep);
}
TEST_CASE("undo on an empty in-memory Replica does nothing") {
Replica *rep = tc_replica_new(NULL);
CHECK(tc_replica_error(rep) == NULL);
int rv = tc_replica_undo(rep);
CHECK(rv == 0);
CHECK(tc_replica_error(rep) == NULL);
tc_replica_free(rep);
}