avoid having to use external test runner script by parsing environment variables directly
This commit is contained in:
@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user