Files
sousa-gecko/intl/gtest/TestAppCollator.cpp
T
Henri Sivonen 1e89ff23d0 Bug 2022559 - Turn on the numeric mode for AppCollator::Compare and AppCollator::CompareBase. r=platform-i18n-reviewers,dminor
Also provide compare() for (potential) Rust callers.

(No compare_base() for Rust, since there are no legacy callers.)

Differential Revision: https://phabricator.services.mozilla.com/D287134
2026-03-13 09:03:19 +00:00

24 lines
651 B
C++

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
#include "gtest/gtest.h"
#include "mozilla/intl/AppCollator.h"
#include "nsString.h"
#define APP_COLLATOR_TEST(name) TEST(AppCollatorTest, name)
using namespace mozilla::intl;
APP_COLLATOR_TEST(Numeric) {
nsAutoCString ten("foo10");
nsAutoCString two("foo2");
nsAutoString ten16(u"foo10");
nsAutoString two16(u"foo2");
ASSERT_EQ(AppCollator::Compare(ten, two), 1);
ASSERT_EQ(AppCollator::CompareBase(ten, two), 1);
ASSERT_EQ(AppCollator::Compare(ten16, two16), 1);
ASSERT_EQ(AppCollator::CompareBase(ten16, two16), 1);
}