mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-21 17:45:25 -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
30 lines
938 B
C++
30 lines
938 B
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 events of GDevelop Core.
|
|
*/
|
|
#include "GDCore/Events/CodeGeneration/EventsCodeGenerator.h"
|
|
#include <memory>
|
|
#include "GDCore/CommonTools.h"
|
|
#include "GDCore/Extensions/Platform.h"
|
|
#include "GDCore/Project/Layout.h"
|
|
#include "GDCore/Project/Project.h"
|
|
#include "GDCore/Tools/VersionWrapper.h"
|
|
#include "catch.hpp"
|
|
|
|
TEST_CASE("EventsCodeGenerator", "[common][events]") {
|
|
SECTION("Basics") {
|
|
gd::Project project;
|
|
auto& layout = project.InsertNewLayout("Layout 1", 0);
|
|
gd::Platform platform;
|
|
gd::EventsCodeGenerator codeGenerator(project, layout, platform);
|
|
|
|
REQUIRE(codeGenerator.ConvertToString(
|
|
"Hello \"world\"!\nThis is a backslash \\") ==
|
|
"Hello \\\"world\\\"!\\nThis is a backslash \\\\");
|
|
}
|
|
}
|