catchorg / catchorg/Catch2

Tag aliases do not work?

Open
#1,242 2 comments 0 reactions 0 assignees View on GitHub
Query
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

## Description
Tag aliases seem to unconditionally throw an exception when trying to run a test with a tag alias.

### Steps to reproduce
Put ```CATCH_REGISTER_TAG_ALIAS("[@myalias]", "[myalias]")``` somewhere
You can use debugger to see that it is indeed executed.

Then put ```["@myalias"]``` on a tag somewhere in scenario.

Try to run the test. It crashes with:

> terminating with uncaught exception of type std::domain_error: Tag name: [@myalias] is not allowed.
> Tag names starting with non alpha-numeric characters are reserved
> \__FILE__:\__LINE__
Aborted

### Extra information
I'm not sure how this would ever work because in catch.hpp ```enforceNotReservedTag``` and ```makeTestCase``` does not check if the ```tag``` is a registered alias or not?

Thus it seems it would always fail?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.