src/developer/debug/zxdb/console/verbs_symbol_unittest.cc
TEST_F(VerbsSymbolTest, SymInfo_Demangle) {
  MockConsole console(&session());

  // Should demangle if given mangled input.
  console.ProcessInputLine("sym-info _ZN3fxl10LogMessage6streamEv");
  auto event = console.GetOutputEvent();
  ASSERT_EQ(MockConsole::OutputEvent::Type::kOutput, event.type);
  ASSERT_EQ(
      "Demangled name: fxl::LogMessage::stream()\n\n"
      "No symbol \"_ZN3fxl10LogMessage6streamEv\" found in the current context.\n",
      event.output.AsString());

  // When input is not mangled it shouldn't show any demangled thing.
  console.ProcessInputLine("sym-info LogMessage6streamEv");
  event = console.GetOutputEvent();
  ASSERT_EQ(MockConsole::OutputEvent::Type::kOutput, event.type);
  ASSERT_EQ("No symbol \"LogMessage6streamEv\" found in the current context.\n",
            event.output.AsString());

  // Shouldn't demangle basic types. "i" would normally be converted to "int" by the demangler.
  console.ProcessInputLine("sym-info i");
  event = console.GetOutputEvent();
  ASSERT_EQ(MockConsole::OutputEvent::Type::kOutput, event.type);
  ASSERT_EQ("No symbol \"i\" found in the current context.\n",
            event.output.AsString());

}
// sym-stat will demangle symbols. It doesn't need any context to do this.
sym-stat will demangle symbols. It doesn't need any context to do this.
sym - stat will demangle symbols . It doesn ' t need any context to do this .
TEST_F(VerbsSymbolTest, SymInfo_Demangle) {
  MockConsole console(&session());
  console.ProcessInputLine("sym-info _ZN3fxl10LogMessage6streamEv");
  auto event = console.GetOutputEvent();
  ASSERT_EQ(MockConsole::OutputEvent::Type::kOutput, event.type);
  ASSERT_EQ(
      "Demangled name: fxl::LogMessage::stream()\n\n"
      "No symbol \"_ZN3fxl10LogMessage6streamEv\" found in the current context.\n",
      event.output.AsString());
  console.ProcessInputLine("sym-info LogMessage6streamEv");
  event = console.GetOutputEvent();
  ASSERT_EQ(MockConsole::OutputEvent::Type::kOutput, event.type);
  ASSERT_EQ("No symbol \"LogMessage6streamEv\" found in the current context.\n",
            event.output.AsString());
  console.ProcessInputLine("sym-info i");
  event = console.GetOutputEvent();
  ASSERT_EQ(MockConsole::OutputEvent::Type::kOutput, event.type);
  ASSERT_EQ("No symbol \"i\" found in the current context.\n",
            event.output.AsString());
}
TEST_F ( VerbsSymbolTest , SymInfo_Demangle ) { MockConsole console ( & session ( ) ) ; console . ProcessInputLine ( " " ) ; auto event = console . GetOutputEvent ( ) ; ASSERT_EQ ( MockConsole :: OutputEvent :: Type :: kOutput , event . type ) ; ASSERT_EQ ( " \n \n " " \" \" \n " , event . output . AsString ( ) ) ; console . ProcessInputLine ( " " ) ; event = console . GetOutputEvent ( ) ; ASSERT_EQ ( MockConsole :: OutputEvent :: Type :: kOutput , event . type ) ; ASSERT_EQ ( " \" \" \n " , event . output . AsString ( ) ) ; console . ProcessInputLine ( " " ) ; event = console . GetOutputEvent ( ) ; ASSERT_EQ ( MockConsole :: OutputEvent :: Type :: kOutput , event . type ) ; ASSERT_EQ ( " \" \" \n " , event . output . AsString ( ) ) ; }
sym-stat will demangle symbols.
sym - stat will demangle symbols .
// Should demangle if given mangled input. // When input is not mangled it shouldn't show any demangled thing. // Shouldn't demangle basic types. "i" would normally be converted to "int" by the demangler.