MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / FormatCountableNoun

Function FormatCountableNoun

tests/gtest/gtest-all.cc:4349–4354  ·  view source on GitHub ↗

Formats a countable noun. Depending on its quantity, either the singular form or the plural form is used. e.g. FormatCountableNoun(1, "formula", "formuli") returns "1 formula". FormatCountableNoun(5, "book", "books") returns "5 books".

Source from the content-addressed store, hash-verified

4347// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
4348// FormatCountableNoun(5, "book", "books") returns "5 books".
4349static std::string FormatCountableNoun(int count,
4350 const char * singular_form,
4351 const char * plural_form) {
4352 return internal::StreamableToString(count) + " " +
4353 (count == 1 ? singular_form : plural_form);
4354}
4355
4356// Formats the count of tests.
4357static std::string FormatTestCount(int test_count) {

Callers 4

FormatTestCountFunction · 0.85
FormatTestSuiteCountFunction · 0.85
OnTestCaseStartMethod · 0.85
OnTestCaseEndMethod · 0.85

Calls 1

StreamableToStringFunction · 0.85

Tested by

no test coverage detected