Skip to content

[NFC][ADT] Format StringRefTest.cpp to fit in 80 columns. #105502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all 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
24 changes: 13 additions & 11 deletions llvm/unittests/ADT/StringRefTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,16 +939,17 @@ struct GetDoubleStrings {
bool AllowInexact;
bool ShouldFail;
double D;
} DoubleStrings[] = {{"0", false, false, 0.0},
{"0.0", false, false, 0.0},
{"-0.0", false, false, -0.0},
{"123.45", false, true, 123.45},
{"123.45", true, false, 123.45},
{"1.8e308", true, false, std::numeric_limits<double>::infinity()},
{"1.8e308", false, true, std::numeric_limits<double>::infinity()},
{"0x0.0000000000001P-1023", false, true, 0.0},
{"0x0.0000000000001P-1023", true, false, 0.0},
};
} DoubleStrings[] = {
{"0", false, false, 0.0},
{"0.0", false, false, 0.0},
{"-0.0", false, false, -0.0},
{"123.45", false, true, 123.45},
{"123.45", true, false, 123.45},
{"1.8e308", true, false, std::numeric_limits<double>::infinity()},
{"1.8e308", false, true, std::numeric_limits<double>::infinity()},
{"0x0.0000000000001P-1023", false, true, 0.0},
{"0x0.0000000000001P-1023", true, false, 0.0},
};

TEST(StringRefTest, getAsDouble) {
for (const auto &Entry : DoubleStrings) {
Expand Down Expand Up @@ -1117,7 +1118,8 @@ TEST(StringRefTest, StringLiteral) {
constexpr StringRef StringRefs[] = {"Foo", "Bar"};
EXPECT_EQ(StringRef("Foo"), StringRefs[0]);
EXPECT_EQ(3u, (std::integral_constant<size_t, StringRefs[0].size()>::value));
EXPECT_EQ(false, (std::integral_constant<bool, StringRefs[0].empty()>::value));
EXPECT_EQ(false,
(std::integral_constant<bool, StringRefs[0].empty()>::value));
Comment on lines +1121 to +1122
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EXPECT_EQ(false,
(std::integral_constant<bool, StringRefs[0].empty()>::value));
EXPECT_FALSE(std::integral_constant<bool, StringRefs[0].empty()>::value);

EXPECT_EQ(StringRef("Bar"), StringRefs[1]);

constexpr StringLiteral Strings[] = {"Foo", "Bar"};
Expand Down
Loading