Skip to content

Commit 333b92d

Browse files
FrankYFTangdeonajulary06
authored andcommitted
issue 163 fix ULocale < and > operator order (#164)
1 parent 2f3a3ac commit 333b92d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

inflection/src/inflection/util/ULocale.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ inflection::util::ULocale::operator!=(const ::inflection::util::ULocale& other)
243243
inline bool
244244
inflection::util::ULocale::operator<(const ::inflection::util::ULocale& other) const
245245
{
246-
return other.fullName < fullName;
246+
return fullName < other.fullName;
247247
}
248248

249249
inline bool
250250
inflection::util::ULocale::operator>(const ::inflection::util::ULocale& other) const
251251
{
252-
return other.fullName > fullName;
252+
return fullName > other.fullName;
253253
}
254254

255255
inline ::std::string_view

inflection/test/src/inflection/util/LocaleUtilsTest.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,18 @@ TEST_CASE("LocaleUtilsTest#hashTest")
5454
{
5555
inflection::util::ULocale locale1 = inflection::util::LocaleUtils::ARABIC();
5656
inflection::util::ULocale locale2 = inflection::util::LocaleUtils::GERMAN();
57+
inflection::util::ULocale locale3 = inflection::util::LocaleUtils::HINDI();
5758

5859
std::set<inflection::util::ULocale> s;
59-
s.insert(locale1);
6060
s.insert(locale2);
61+
s.insert(locale1);
62+
s.insert(locale3);
6163

6264
auto it = s.begin();
6365

64-
REQUIRE(locale2 == *it);
65-
REQUIRE(locale1 == *(++it));
66+
REQUIRE(locale1 == *it);
67+
REQUIRE(locale2 == *(++it));
68+
REQUIRE(locale3 == *(++it));
6669
}
6770

6871
TEST_CASE("LocaleUtilsTest#testCoverage")

0 commit comments

Comments
 (0)