Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shell/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static const std::string kAllowedDartFlags[] = {
"--null_assertions",
"--strict_null_safety_checks",
"--max_subtype_cache_entries",
"--enable-asserts",
};
// clang-format on

Expand Down
12 changes: 12 additions & 0 deletions shell/common/switches_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ TEST(SwitchesTest, NoEnableImpeller) {
}
}

TEST(SwitchesTest, EnableAsserts) {
fml::CommandLine command_line = fml::CommandLineFromInitializerList(
{"command", "--dart-flags=--enable-asserts"});
Settings settings = SettingsFromCommandLine(command_line);
#if !FLUTTER_RELEASE
ASSERT_EQ(settings.dart_flags.size(), 1ul);
EXPECT_EQ(settings.dart_flags[0], "--enable-asserts");
#else
EXPECT_TRUE(settings.dart_flags.empty());
#endif
}

} // namespace testing
} // namespace flutter

Expand Down