zircon/system/utest/fidl-compiler/formatter_tests.cc
// Tests that repeatedly applying the formatter results in no change.
Tests that repeatedly applying the formatter results in no change.
Tests that repeatedly applying the formatter results in no change .
TEST(FormatterTests, idempotence_test) {
  InitializeContents();
  for (auto element : formatted_output_) {
    TestLibrary library(element.first, element.second);
    std::unique_ptr<fidl::raw::File> ast;
    EXPECT_TRUE(library.Parse(&ast));
    fidl::raw::FormattingTreeVisitor visitor;
    visitor.OnFile(ast);
    EXPECT_STR_EQ(element.second.c_str(), visitor.formatted_output()->c_str(),
                  "Applying formatting multiple times produces different results");
  }
}
TEST ( FormatterTests , idempotence_test ) { InitializeContents ( ) ; for ( auto element : formatted_output_ ) { TestLibrary library ( element . first , element . second ) ; std :: unique_ptr < fidl :: raw :: File > ast ; EXPECT_TRUE ( library . Parse ( & ast ) ) ; fidl :: raw :: FormattingTreeVisitor visitor ; visitor . OnFile ( ast ) ; EXPECT_STR_EQ ( element . second . c_str ( ) , visitor . formatted_output ( ) -> c_str ( ) , " " ) ; } }
Tests that repeatedly applying the formatter results in no change.
Tests that repeatedly applying the formatter results in no change .