From 3f2e636e34a6988793ee94768d457c42069965b6 Mon Sep 17 00:00:00 2001 From: lukpo Date: Fri, 13 Aug 2021 09:25:04 +0200 Subject: [PATCH] added CommentTest to GameFormulaParserTest.cpp --- src/test/storm/parser/GameFormulaParserTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/storm/parser/GameFormulaParserTest.cpp b/src/test/storm/parser/GameFormulaParserTest.cpp index ede75a6ad..82979d17f 100644 --- a/src/test/storm/parser/GameFormulaParserTest.cpp +++ b/src/test/storm/parser/GameFormulaParserTest.cpp @@ -243,4 +243,16 @@ TEST(GameFormulaParserTest, NestedPathFormulaTest) { EXPECT_TRUE(formula->asGameFormula().getSubformula().isProbabilityOperatorFormula()); ASSERT_TRUE(formula->asGameFormula().getSubformula().asProbabilityOperatorFormula().getSubformula().isEventuallyFormula()); ASSERT_TRUE(formula->asGameFormula().getSubformula().asProbabilityOperatorFormula().getSubformula().asEventuallyFormula().getSubformula().isNextFormula()); +} + +TEST(GameFormulaParserTest, CommentTest) { + storm::parser::FormulaParser formulaParser; + + std::string input = "// This is a comment. And this is a commented out formula: <

> P<=0.5 [ F \"a\" ] The next line contains the actual formula. \n<

> P<=0.5 [ X \"b\" ] // Another comment \n // And again: another comment."; + std::shared_ptr formula(nullptr); + ASSERT_NO_THROW(formula = formulaParser.parseSingleFormulaFromString(input)); + EXPECT_TRUE(formula->isGameFormula()); + EXPECT_TRUE(formula->asGameFormula().getSubformula().isProbabilityOperatorFormula()); + ASSERT_TRUE(formula->asGameFormula().getSubformula().asProbabilityOperatorFormula().getSubformula().isNextFormula()); + ASSERT_TRUE(formula->asGameFormula().getSubformula().asProbabilityOperatorFormula().getSubformula().asNextFormula().getSubformula().isAtomicLabelFormula()); } \ No newline at end of file