8 #include <framework/utilities/TestHelpers.h>
9 #include <framework/utilities/MakeROOTCompatible.h>
11 #include <gtest/gtest.h>
18 TEST(VariableTest, makeROOTCompatible)
20 EXPECT_EQ(
"", MakeROOTCompatible::makeROOTCompatible(
""));
21 EXPECT_EQ(
"test", MakeROOTCompatible::makeROOTCompatible(
"test"));
22 EXPECT_EQ(
"test213", MakeROOTCompatible::makeROOTCompatible(
"test213"));
23 EXPECT_EQ(
"test_23", MakeROOTCompatible::makeROOTCompatible(
"test_23"));
25 EXPECT_EQ(
"", MakeROOTCompatible::makeROOTCompatible(
""));
26 EXPECT_EQ(
"test", MakeROOTCompatible::makeROOTCompatible(
"test"));
27 EXPECT_EQ(
"test213", MakeROOTCompatible::makeROOTCompatible(
"test213"));
28 EXPECT_EQ(
"test_23", MakeROOTCompatible::makeROOTCompatible(
"test_23"));
30 EXPECT_EQ(
"test__bo23__bc", MakeROOTCompatible::makeROOTCompatible(
"test(23)"));
31 EXPECT_EQ(
"test__so23__sc", MakeROOTCompatible::makeROOTCompatible(
"test[23]"));
32 EXPECT_EQ(
"test__co23__cc", MakeROOTCompatible::makeROOTCompatible(
"test{23}"));
33 EXPECT_EQ(
"test__boe__pl__clgamma__cm__spM__sp__st__sp3__bc", MakeROOTCompatible::makeROOTCompatible(
"test(e+:gamma, M < 3)"));
34 EXPECT_EQ(
"__cl__bo__bc__sp__bo__bc__cm", MakeROOTCompatible::makeROOTCompatible(
":() (),"));
35 EXPECT_EQ(
"c__cl__bo__bcb__sp__bo__bc__cma", MakeROOTCompatible::makeROOTCompatible(
"c:()b (),a"));
36 EXPECT_EQ(
"c__cl__bo__cm__pl8951aBZWVZUEOH_Rhtnsq__bcb__sp__bo__bc__cma",
37 MakeROOTCompatible::makeROOTCompatible(
"c:(,+8951aBZWVZUEOH_Rhtnsq)b (),a"));
38 EXPECT_EQ(
"foo__bobar__cm__mi0__pt123__cm__sp94__bc", MakeROOTCompatible::makeROOTCompatible(
"foo(bar,-0.123, 94)"));
40 for (
const auto& pair : MakeROOTCompatible::getSubstitutionMap()) {
41 EXPECT_EQ(pair.second, MakeROOTCompatible::makeROOTCompatible(pair.first));
44 EXPECT_NO_B2WARNING(MakeROOTCompatible::makeROOTCompatible(
"test_a"));
45 EXPECT_B2WARNING(MakeROOTCompatible::makeROOTCompatible(
"test__a"));
48 TEST(VariableTest, invertMakeROOTCompatible)
50 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
""),
"");
51 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test"),
"test");
52 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test213"),
"test213");
53 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test_23"),
"test_23");
55 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
""),
"");
56 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test"),
"test");
57 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test213"),
"test213");
58 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test_23"),
"test_23");
60 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test__bo23__bc"),
"test(23)");
61 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test__so23__sc"),
"test[23]");
62 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test__co23__cc"),
"test{23}");
63 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"test__boe__pl__clgamma__cm__spM__sp__st__sp3__bc"),
64 "test(e+:gamma, M < 3)");
65 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"__cl__bo__bc__sp__bo__bc__cm"),
":() (),");
66 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"c__cl__bo__bcb__sp__bo__bc__cma"),
"c:()b (),a");
67 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"c__cl__bo__cm__pl8951aBZWVZUEOH_Rhtnsq__bcb__sp__bo__bc__cma"),
68 "c:(,+8951aBZWVZUEOH_Rhtnsq)b (),a");
69 EXPECT_EQ(MakeROOTCompatible::invertMakeROOTCompatible(
"foo__bobar__cm__mi0__pt123__cm__sp94__bc"),
"foo(bar,-0.123, 94)");
71 for (
const auto& pair : MakeROOTCompatible::getSubstitutionMap()) {
72 EXPECT_EQ(pair.first, MakeROOTCompatible::invertMakeROOTCompatible(pair.second));
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Abstract base class for different kinds of events.