blob: 546c616a3d181bb01f634dd449ec403bd8580aa9 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/dom/FirstLetterPseudoElement.h"
#include <gtest/gtest.h>
namespace blink {
class FirstLetterPseudoElementTest : public ::testing::Test {};
TEST_F(FirstLetterPseudoElementTest, DoesNotBreakEmoji) {
const UChar emoji[] = {0xD83D, 0xDE31, 0};
EXPECT_EQ(2u, FirstLetterPseudoElement::FirstLetterLength(emoji));
}
TEST_F(FirstLetterPseudoElementTest, UnicodePairBreaking) {
const UChar test_string[] = {0xD800, 0xDD00, 'A', 0xD800, 0xDD00,
0xD800, 0xDD00, 'B', 0};
EXPECT_EQ(7u, FirstLetterPseudoElement::FirstLetterLength(test_string));
}
} // namespace blink