slint/api/sixtyfps-cpp/tests/tests.cpp

38 lines
No EOL
922 B
C++

/* LICENSE BEGIN
This file is part of the SixtyFPS Project -- https://sixtyfps.io
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
Copyright (c) 2020 Simon Hausmann <simon.hausmann@sixtyfps.io>
SPDX-License-Identifier: GPL-3.0-only
This file is also available under commercial licensing terms.
Please contact info@sixtyfps.io for more information.
LICENSE END */
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
#include <sixtyfps.h>
#include <sixtyfps_interpreter.h>
SCENARIO("SharedString API")
{
sixtyfps::SharedString str;
REQUIRE(str.empty());
SECTION("Construct from string_view")
{
std::string foo("Foo");
std::string_view foo_view(foo);
str = foo_view;
REQUIRE(str == "Foo");
}
}
SCENARIO("Value API")
{
using namespace sixtyfps::interpreter;
Value str;
REQUIRE(str.type() == Value::Type::Void);
}