1
0
forked from Alepha/Alepha

Fix some bugs in iostream exception handling for expansions.

This commit is contained in:
2023-12-02 04:25:32 -05:00
parent b9de163083
commit bf207244b6
2 changed files with 21 additions and 4 deletions

View File

@ -38,7 +38,7 @@ static auto init= enroll <=[]
},
};
"An exception should be thrown when there is a trailing unenclosed variable."_test <=TableTest< Alepha::expandVariables >::ExceptionCases
"An exception should be thrown when there is a trailing unenclosed variable."_test <=TableTest< Alepha::expandVariables >::Cases
{
{ "Complete var",
{ "$H$ $W$", { { "H", lambaste<="Hello" }, { "W", lambaste<="World" } }, '$' },
@ -46,11 +46,15 @@ static auto init= enroll <=[]
},
{ "Complete var",
{ "$H$ $W$", { { "H", lambaste<="Hello" }, { "W", lambaste<="World" } }, '$' },
std::type_identity< void >{}
"Hello World"
},
{ "Incomplete var",
{ "$H$ $W", { { "H", lambaste<="Hello" }, { "W", lambaste<="World" } }, '$' },
std::type_identity< std::exception >{}
std::runtime_error{ "Unterminated variable `W` in expansion." }
},
{ "Missing var",
{ "$H$ $W$", { { "W", lambaste<="World" } }, '$' },
std::runtime_error{ "No such variable: `H`" }
},
};