blob: 4ef6185149d4b99676598321b8d367d247e859a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// Copyright 2025 Steven Le Rouzic
//
// SPDX-License-Identifier: BSD-3-Clause
#include "asl/strings/string.hpp"
#include "asl/testing/testing.hpp"
#include "asl/formatting/format.hpp"
ASL_TEST(default)
{
asl::string s;
ASL_TEST_ASSERT(s.size() == 0);
ASL_TEST_ASSERT(s.as_string_view().size() == 0);
ASL_TEST_ASSERT(s == ""_sv);
ASL_TEST_ASSERT(s == s);
}
ASL_TEST(from_string_view)
{
asl::string s = "hello"_sv;
ASL_TEST_ASSERT(s.size() == 5);
ASL_TEST_ASSERT(s == "hello"_sv);
}
static_assert(asl::formattable<asl::string<>>);
|