Lolly 1.4.27
Loading...
Searching...
No Matches
Functions
string_view_test.cpp File Reference
#include "a_lolly_test.hpp"
#include "lolly/data/string_u16.hpp"
#include "lolly/data/string_view.hpp"
#include <doctest/doctest.h>
Include dependency graph for string_view_test.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("construct string_view")
 

Detailed Description

Test for string_view

Author
jingkaimori
Date
2024

Definition in file string_view_test.cpp.

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "construct string_view" )

Definition at line 16 of file string_view_test.cpp.

16 {
17 const char16_t arr[6]= u"hello";
18 CHECK (string_u16_view (arr) == u"hello");
19 const char16_t arr3[6]= {u'5', u'c', u'h', u'a', u'r', u's'};
20 CHECK (string_u16_view (arr3) == u"5char");
21
22 const char16_t arr11[12]= u"hello";
24 CHECK (view11.N == 11);
25 CHECK (view11 (0, 5) == u"hello");
26
27 CHECK (string_u16_view (u"abc") == u"abc");
28
29 const char16_t* str= u"def";
30 CHECK (string_u16_view (str, 3) == u"def");
31
32 const std::u16string std_str (u"ghij");
33 CHECK (string_u16_view (std_str) == u"ghij");
34}
The list class represents a linked list.
Definition list.hpp:48
list(T item)
Construct a new list object with a single item.
Definition list.hpp:137
lolly::data::string_view< char16_t > string_u16_view