Removes separated unit test executables
parent
69d988332c
commit
25f87306b4
@ -0,0 +1,7 @@
|
||||
file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false *test.cpp)
|
||||
dfhack_test(test-library "${TEST_SOURCES}")
|
||||
|
||||
# How to get `test` to ensure everything is up to date before running
|
||||
# tests? This add_dependencies() fails with:
|
||||
# Cannot add target-level dependencies to non-existent target "test".
|
||||
#add_dependencies(test MiscUtils.test)
|
@ -1,26 +1,19 @@
|
||||
|
||||
#include "MiscUtils.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
TEST(MiscUtils, wordwrap) {
|
||||
std::vector<std::string> result;
|
||||
|
||||
std::cout << "MiscUtils.wordwrap: 0 wrap" << "... ";
|
||||
word_wrap(&result, "123", 3);
|
||||
ASSERT_EQ(result.size(), 1);
|
||||
std::cout << "ok\n";
|
||||
|
||||
result.clear();
|
||||
std::cout << "MiscUtils.wordwrap: 1 wrap" << "... ";
|
||||
word_wrap(&result, "12345", 3);
|
||||
ASSERT_EQ(result.size(), 2);
|
||||
std::cout << "ok\n";
|
||||
|
||||
result.clear();
|
||||
std::cout << "MiscUtils.wordwrap: 2 wrap" << "... ";
|
||||
word_wrap(&result, "1234567", 3);
|
||||
ASSERT_EQ(result.size(), 3);
|
||||
std::cout << "ok\n";
|
||||
}
|
Loading…
Reference in New Issue