Skip to content

Commit

Permalink
PARSE TESTS WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 25, 2024
1 parent 8375c6f commit 618a70c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nano/core_test/enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,13 @@ TEST (enums, log_category)
ASSERT_FALSE (to_string (nano::log::type::_last).empty ());
ASSERT_NO_THROW (std::string{ to_string (nano::log::type::_last) });
ASSERT_EQ (to_string (nano::log::type::_last), "_last");
}

TEST (log_enums, parse_level)
{
ASSERT_EQ (nano::log::parse_level ("error"), nano::log::level::error);
ASSERT_EQ (nano::log::parse_level ("off"), nano::log::level::off);
ASSERT_THROW (nano::log::parse_level ("invalid"), std::invalid_argument);
ASSERT_THROW (nano::log::parse_level (""), std::invalid_argument);
ASSERT_THROW (nano::log::parse_level ("_error"), std::invalid_argument);
}

0 comments on commit 618a70c

Please sign in to comment.