mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Disallow empty tags in test case specification
This commit is contained in:
@@ -39,6 +39,9 @@ TEST_CASE( "Tag alias can be registered against tag patterns" ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Dummy line info for creating dummy test cases below
|
||||
constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO;
|
||||
|
||||
TEST_CASE("shortened hide tags are split apart", "[tags]") {
|
||||
using Catch::StringRef;
|
||||
using Catch::Matchers::VectorContains;
|
||||
@@ -60,3 +63,9 @@ TEST_CASE("tags with dots in later positions are not parsed as hidden", "[tags]"
|
||||
REQUIRE(testcase->tags.size() == 1);
|
||||
REQUIRE(testcase->tags[0].original == "magic.tag"_catch_sr);
|
||||
}
|
||||
|
||||
TEST_CASE( "empty tags are not allowed", "[tags]" ) {
|
||||
REQUIRE_THROWS(
|
||||
Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user