Skip to content

Commit 5ef9da8

Browse files
ferdymercuryvepadulano
authored andcommitted
[test] verify that TFormula open bracket does not go into infinite loop
[test] test also opening parenthesis
1 parent f00b04e commit 5ef9da8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

hist/hist/test/test_TFormula.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,12 @@ TEST(TFormulaPolTest, CompoundExpressions)
9898
TFormula f1("f1", "pol1(x,0) + pol1(y,2)");
9999
EXPECT_EQ(f1.GetExpFormula(), TString("([p0]+[p1]*x)+([p2]+[p3]*y)"));
100100
}
101+
102+
// https://github.com/root-project/root/issues/21104
103+
TEST(TFormula, SingleOpeningBracket)
104+
{
105+
TFormula f1("f1", "[");
106+
EXPECT_EQ(f1.GetNdim(), 0);
107+
TFormula f2("f2", "(");
108+
EXPECT_EQ(f2.GetNdim(), 0);
109+
}

0 commit comments

Comments
 (0)