Add unit tests for most of util.cpp
This commit is contained in:
@@ -20,9 +20,9 @@
|
||||
// - remove blank lines
|
||||
// - remove comment lines
|
||||
//
|
||||
util::stringvec read_control_lst(const std::string &path) {
|
||||
util::stringvec lines = util::get_file_lines(path);
|
||||
util::stringvec result;
|
||||
util::StringVec read_control_lst(const std::string &path) {
|
||||
util::StringVec lines = util::get_file_lines(path);
|
||||
util::StringVec result;
|
||||
for (int i = 0; i < int(lines.size()); i++) {
|
||||
std::string trimmed = util::trim(lines[i]);
|
||||
if ((trimmed.size() > 0) && (trimmed[0] != '#')) {
|
||||
@@ -173,7 +173,7 @@ void SourceDB::update() {
|
||||
}
|
||||
|
||||
// Read the list of filenames.
|
||||
util::stringvec filenames = read_control_lst("lua/control.lst");
|
||||
util::StringVec filenames = read_control_lst("lua/control.lst");
|
||||
if (filenames.empty()) {
|
||||
luaL_error(L, "cannot read source database control.lst");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user