src/modular/lib/modular_config/modular_config_unittest.cc
// Test that ModularConfigReader accepts JSON documents that contain comments
Test that ModularConfigReader accepts JSON documents that contain comments
Test that ModularConfigReader accepts JSON documents that contain comments
TEST_F(ModularConfigReaderTest, ParseComments) {
  std::string config_contents = R"({
    "basemgr": {
      /* This is
       * a comment */
      "session_shells": [
        {
          // This is another comment
          "url": "fuchsia-pkg://example.com/test#meta/test.cmx"
        }
      ]
    }
  })";
  modular::PseudoDirServer server(modular::MakeFilePathWithContents(
      files::JoinPath(modular_config::kOverriddenConfigDir, modular_config::kStartupConfigFilePath),
      config_contents));
  modular::ModularConfigReader reader(server.OpenAt("."));
  auto config = reader.GetBasemgrConfig();
  EXPECT_EQ(1u, config.session_shell_map().size());
}
TEST_F ( ModularConfigReaderTest , ParseComments ) { std :: string config_contents = R" ( {
    "basemgr": {
      /* This is
       * a comment */
      "session_shells": [
        {
          // This is another comment
          "url": "fuchsia-pkg://example.com/test#meta/test.cmx"
        }
      ]
    }
  } ) " ; modular :: PseudoDirServer server ( modular :: MakeFilePathWithContents ( files :: JoinPath ( modular_config :: kOverriddenConfigDir , modular_config :: kStartupConfigFilePath ) , config_contents ) ) ; modular :: ModularConfigReader reader ( server . OpenAt ( " " ) ) ; auto config = reader . GetBasemgrConfig ( ) ; EXPECT_EQ ( 1u , config . session_shell_map ( ) . size ( ) ) ; }
Test that ModularConfigReader accepts JSON documents that contain comments
Test that ModularConfigReader accepts JSON documents that contain comments
// Verify that ModularConfigReader parsed the config.