mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-21 09:35:27 -04:00
a8559bfbbc
* Update all CMakeLists of extensions to use clang-format * Run clang-format on all Extensions * Update GDCore CMakeLists.txt to add clang-format * Run clang-format on GDCore files * Update GDJS and GDCpp CMakeLists.txt to add clang-format * Run clang-format on GDCpp and GDJS files
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
/*
|
|
* GDevelop Core
|
|
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
|
|
* reserved. This project is released under the MIT License.
|
|
*/
|
|
/**
|
|
* @file Tests covering common features of GDevelop Core.
|
|
*/
|
|
#include "GDCore/IDE/NewNameGenerator.h"
|
|
#include "GDCore/String.h"
|
|
#include "catch.hpp"
|
|
|
|
TEST_CASE("NewNameGenerator", "[common]") {
|
|
SECTION("Basics") {
|
|
REQUIRE(gd::NewNameGenerator::Generate(
|
|
"Test", "abc", [](const gd::String &) { return false; }) ==
|
|
"Test");
|
|
REQUIRE(gd::NewNameGenerator::Generate(
|
|
"Test", "abc", [](const gd::String &name) {
|
|
return name == "Test";
|
|
}) == "abcTest");
|
|
REQUIRE(gd::NewNameGenerator::Generate(
|
|
"Test", "abc", [](const gd::String &name) {
|
|
return name == "Test" || name == "abcTest";
|
|
}) == "abcTest2");
|
|
REQUIRE(gd::NewNameGenerator::Generate(
|
|
"Test", "abc", [](const gd::String &name) {
|
|
return name == "Test" || name == "abcTest" ||
|
|
name == "abcTest2";
|
|
}) == "abcTest3");
|
|
}
|
|
}
|