AK: Fix StringUtils tests to actually observe return value.

Noticed this while playing around with making Optional<T>
nodiscard.
This commit is contained in:
Brian Gianforcaro 2020-08-05 03:11:59 -07:00 committed by Andreas Kling
parent 88092376f3
commit 125eab998f
Notes: sideshowbarker 2024-07-19 04:17:18 +09:00

View file

@ -72,16 +72,16 @@ TEST_CASE(convert_to_int)
auto value = AK::StringUtils::convert_to_int(StringView());
EXPECT(!value.has_value());
AK::StringUtils::convert_to_int("");
value = AK::StringUtils::convert_to_int("");
EXPECT(!value.has_value());
AK::StringUtils::convert_to_int("a");
value = AK::StringUtils::convert_to_int("a");
EXPECT(!value.has_value());
AK::StringUtils::convert_to_int("+");
value = AK::StringUtils::convert_to_int("+");
EXPECT(!value.has_value());
AK::StringUtils::convert_to_int("-");
value = AK::StringUtils::convert_to_int("-");
EXPECT(!value.has_value());
auto actual = AK::StringUtils::convert_to_int("0");
@ -133,7 +133,7 @@ TEST_CASE(convert_to_uint)
value = AK::StringUtils::convert_to_uint("+1");
EXPECT(!value.has_value());
AK::StringUtils::convert_to_uint("-1");
value = AK::StringUtils::convert_to_uint("-1");
EXPECT(!value.has_value());
auto actual = AK::StringUtils::convert_to_uint("0");