src/developer/debug/zxdb/expr/expr_parser_unittest.cc
// Tests parsing identifier names that require lookups from the symbol system. See TestLookupName
// above for the mocked symbol rules.
Tests parsing identifier names that require lookups from the symbol system. See TestLookupName
above for the mocked symbol rules.
Tests parsing identifier names that require lookups from the symbol system . See TestLookupName above for the mocked symbol rules .
TEST_F(ExprParserTest, NamesWithSymbolLookup) {
  auto result = Parse("Namespace", &TestLookupName);
  ASSERT_FALSE(result);
  EXPECT_EQ("Expected expression after namespace name.", parser().err().msg());
  result = Parse("Template", &TestLookupName);
  ASSERT_FALSE(result);
  EXPECT_EQ("Expected template args after template name.", parser().err().msg());
  result = Parse("Namespace::", &TestLookupName);
  ASSERT_FALSE(result);
  EXPECT_EQ("Expected name after '::'.", parser().err().msg());
  result = Parse("Type<int>", &TestLookupName);
  ASSERT_FALSE(result);
  EXPECT_EQ("Template parameters not valid on this object type.", parser().err().msg());
  result = Parse("Namespace<int>", &TestLookupName);
  ASSERT_FALSE(result);
  EXPECT_EQ("Template parameters not valid on this object type.", parser().err().msg());
  EXPECT_EQ(
      "FUNCTIONCALL\n"
      " IDENTIFIER(\"Namespace\"; ::\"Template\",<\"int\">; ::\"fn\")\n",
      GetParseString("Namespace::Template<int>::fn()", &TestLookupName));
}
TEST_F ( ExprParserTest , NamesWithSymbolLookup ) { auto result = Parse ( " " , & TestLookupName ) ; ASSERT_FALSE ( result ) ; EXPECT_EQ ( " " , parser ( ) . err ( ) . msg ( ) ) ; result = Parse ( " " , & TestLookupName ) ; ASSERT_FALSE ( result ) ; EXPECT_EQ ( " " , parser ( ) . err ( ) . msg ( ) ) ; result = Parse ( " " , & TestLookupName ) ; ASSERT_FALSE ( result ) ; EXPECT_EQ ( " " , parser ( ) . err ( ) . msg ( ) ) ; result = Parse ( " " , & TestLookupName ) ; ASSERT_FALSE ( result ) ; EXPECT_EQ ( " " , parser ( ) . err ( ) . msg ( ) ) ; result = Parse ( " " , & TestLookupName ) ; ASSERT_FALSE ( result ) ; EXPECT_EQ ( " " , parser ( ) . err ( ) . msg ( ) ) ; EXPECT_EQ ( " \n " " \" \" \" \" \" \" \" \" \n " , GetParseString ( " " , & TestLookupName ) ) ; }
Tests parsing identifier names that require lookups from the symbol system.
Tests parsing identifier names that require lookups from the symbol system .
// Bare namespace is an error. // Bare template is an error. // Nothing after "::" // Can't put a template on a type that's not a template. // This error message might change with future type support because it might look like a // comparison between a type and an int. // Can't put a template on a namespace. // Good type name.