Files
GDevelop/Core/tests/EventsCodeGenerator.cpp
T
Florian Rival a8559bfbbc Add clang-format to format (C++) source files automatically (#491)
* 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
2018-05-09 15:57:38 -07:00

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 \\\\");
}
}