aboutsummaryrefslogtreecommitdiff
path: root/libc/test/src/wchar/wcslen_test.cpp
blob: 9cf446564c07ed7dd681977f7d4c1a3022e3441a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//===-- Unittests for wcslen ----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "hdr/types/size_t.h"
#include "hdr/types/wchar_t.h"
#include "src/wchar/wcslen.h"
#include "test/UnitTest/Test.h"

TEST(LlvmLibcWCSLenTest, EmptyString) {
  ASSERT_EQ(size_t{0}, LIBC_NAMESPACE::wcslen(L""));
}

TEST(LlvmLibcWCSLenTest, AnyString) {
  ASSERT_EQ(size_t{12}, LIBC_NAMESPACE::wcslen(L"Hello World!"));
}