feat(linear-static-3d-euler-beam): step 12 - inp-domain-mapping-review-fix
This commit is contained in:
@@ -573,6 +573,41 @@ TEST(InpDomainMapping, RejectsUnsupportedAndInvalidPortfolio) {
|
||||
EXPECT_FALSE(diagnostic->location.file.empty());
|
||||
EXPECT_GT(diagnostic->location.line, 0U);
|
||||
}
|
||||
|
||||
struct SameTokenAmbiguityCase {
|
||||
std::string name;
|
||||
std::string deck;
|
||||
std::string expectedKeyword;
|
||||
std::size_t expectedLine;
|
||||
};
|
||||
const std::string sameTokenBase = replaceOnce(
|
||||
base,
|
||||
"*Elset, elset=BeamSet",
|
||||
"*Nset, nset=1\n2\n*Elset, elset=BeamSet");
|
||||
const std::vector<SameTokenAmbiguityCase> sameTokenCases{
|
||||
{"boundary", replaceOnce(sameTokenBase, "Root, 1, 6", "1, 1, 6"),
|
||||
"BOUNDARY", 27U},
|
||||
{"cload", replaceOnce(sameTokenBase, "Tip, 2, -1.", "1, 2, -1."),
|
||||
"CLOAD", 32U}};
|
||||
|
||||
for (const auto& testCase : sameTokenCases) {
|
||||
SCOPED_TRACE("same-token-" + testCase.name);
|
||||
auto result = mapText("same-token-" + testCase.name, testCase.deck);
|
||||
ASSERT_FALSE(result.hasValue());
|
||||
EXPECT_EQ(
|
||||
result.status().failureCategory(),
|
||||
fesa::FailureCategory::input);
|
||||
const auto* diagnostic =
|
||||
findDiagnostic(result.status(), "unresolved-reference");
|
||||
ASSERT_NE(diagnostic, nullptr);
|
||||
EXPECT_EQ(diagnostic->severity, fesa::Severity::error);
|
||||
EXPECT_EQ(diagnostic->keyword, testCase.expectedKeyword);
|
||||
EXPECT_EQ(diagnostic->entityIdentity, "1");
|
||||
EXPECT_EQ(diagnostic->location.line, testCase.expectedLine);
|
||||
EXPECT_EQ(
|
||||
diagnostic->location.file.filename().string(),
|
||||
"fesa-domain-mapper-same-token-" + testCase.name + ".inp");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(InpDomainMapping, RejectsDloadWithoutDistributedLoadObject) {
|
||||
|
||||
Reference in New Issue
Block a user