barelymusician/algorithm/context_free_grammar_test.cpp
// Tests that no substitutions are done when there are no rules given.
Tests that no substitutions are done when there are no rules given.
Tests that no substitutions are done when there are no rules given .
TEST(ContextFreeGrammarTest, GenerateSequenceNoRules) {
  const int kStartSymbol = 0;
  ContextFreeGrammar<int> grammar;
  Random random;
  const auto sequence = grammar.GenerateSequence(kStartSymbol, random);
  EXPECT_THAT(sequence, ElementsAre(kStartSymbol));
}
TEST ( ContextFreeGrammarTest , GenerateSequenceNoRules ) { const int kStartSymbol = 0 ; ContextFreeGrammar < int > grammar ; Random random ; const auto sequence = grammar . GenerateSequence ( kStartSymbol , random ) ; EXPECT_THAT ( sequence , ElementsAre ( kStartSymbol ) ) ; }
Tests that no substitutions are done when there are no rules given.
Tests that no substitutions are done when there are no rules given .