/** * tests/t00056/test_case.h * * Copyright (c) 2021-2024 Bartek Kryza * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ TEST_CASE("t00056") { using namespace clanguml::test; auto [config, db, diagram, model] = CHECK_CLASS_MODEL("t00056", "t00056_class"); CHECK_CLASS_DIAGRAM(*config, diagram, *model, [](const auto &src) { REQUIRE(IsConcept(src, "greater_than_simple")); REQUIRE(IsConcept(src, "greater_than_with_requires")); REQUIRE(IsConcept(src, "max_four_bytes")); REQUIRE(IsConcept(src, "iterable")); REQUIRE(IsConcept(src, "has_value_type")); REQUIRE(IsConcept(src, "convertible_to_string")); REQUIRE(IsConcept(src, "iterable_with_value_type")); REQUIRE(IsConcept(src, "iterable_or_small_value_type")); REQUIRE(IsConceptParameterList( src, "greater_than_with_requires", "(T l,P r)")); REQUIRE(IsConceptRequirement( src, "greater_than_with_requires", "sizeof (l) > sizeof (r)")); REQUIRE(IsConceptRequirement(src, "iterable", "container.begin()")); REQUIRE(IsConceptRequirement(src, "iterable", "container.end()")); #if (LLVM_VERSION_MAJOR == 13) || (LLVM_VERSION_MAJOR == 14) REQUIRE(IsConceptRequirement( src, "convertible_to_string", "std::string({s})")); #else REQUIRE( IsConceptRequirement( src,"convertible_to_string", "std::string{s}")); #endif REQUIRE(IsConceptRequirement( src, "convertible_to_string", "{std::to_string(s)} noexcept")); REQUIRE(IsConceptRequirement(src, "convertible_to_string", "{std::to_string(s)} -> std::same_as")); REQUIRE(IsClassTemplate(src, "A")); REQUIRE(IsClassTemplate(src, "B")); REQUIRE(IsClassTemplate(src, "C")); REQUIRE(IsClassTemplate(src, "D")); REQUIRE(IsClassTemplate(src, "E")); REQUIRE(IsClassTemplate(src, "F")); REQUIRE( IsConstraint(src, "A", "max_four_bytes", "T")); REQUIRE(IsConstraint(src, "D", "max_four_bytes", "T2")); REQUIRE(IsConstraint(src, "D", "max_four_bytes", "T5")); REQUIRE(IsConstraint( src, "D", "iterable", "T1")); REQUIRE(IsConstraint( src, "D", "iterable", "T3")); REQUIRE(IsConstraint( src, "iterable_with_value_type", "has_value_type", "T")); REQUIRE(IsConstraint( src, "iterable_or_small_value_type", "max_four_bytes", "T")); REQUIRE(IsConstraint(src, "iterable_or_small_value_type", "iterable_with_value_type", "T")); REQUIRE(IsConstraint( src, "E", "greater_than_with_requires", "T1,T3")); REQUIRE(IsConstraint( src, "F", "greater_than_simple", "T1,T3")); }); }