avoid having to use external test runner script by parsing environment variables directly

This commit is contained in:
Axel Kohlmeyer
2020-06-24 09:32:59 -04:00
parent 8cec13a038
commit ee5be42026
6 changed files with 137 additions and 28 deletions

View File

@ -18,6 +18,7 @@
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
using namespace LAMMPS_NS;
using ::testing::Eq;
@ -48,6 +49,24 @@ TEST(Utils, count_words_with_extra_spaces)
ASSERT_EQ(utils::count_words(" some text # comment "), 4);
}
TEST(Utils, split_words_simple)
{
std::vector<std::string> list = utils::split_words("one two three");
ASSERT_EQ(list.size(), 3);
}
TEST(Utils, split_words_quoted)
{
std::vector<std::string> list = utils::split_words("one 'two' \"three\"");
ASSERT_EQ(list.size(), 3);
}
TEST(Utils, split_words_escaped)
{
std::vector<std::string> list = utils::split_words("1\\' '\"two\"' 3\\\"");
ASSERT_EQ(list.size(), 3);
}
TEST(Utils, valid_integer1)
{
ASSERT_TRUE(utils::is_integer("10"));