Added namespaces to most classes, general cleanup
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Basic conditional", "[integration]" ) {
|
||||
Script* script = Script::Create("if true then foo = true end");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
|
||||
using namespace Porygon;
|
||||
TEST_CASE( "Diagnostic invalid character", "[integration]" ) {
|
||||
auto script = Script::Create("1 + 1 @");
|
||||
REQUIRE(script->Diagnostics -> HasErrors());
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
|
||||
using namespace Porygon;
|
||||
TEST_CASE( "True Equals True", "[integration]" ) {
|
||||
auto script = Script::Create("true == true");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Define script function", "[integration]" ) {
|
||||
Script* script = Script::Create("function add(number a, number b) a + b end");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "String indexing", "[integration]" ) {
|
||||
auto script = Script::Create("'foobar'[4]");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Basic True", "[integration]" ) {
|
||||
auto script = Script::Create("true");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Integer Negation", "[integration]" ) {
|
||||
auto script = Script::Create("-60");
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Simple String", "[integration]" ) {
|
||||
auto script = Script::Create("\"foo bar\"");
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
#include "../../src/Evaluator/EvalValues/TableEvalValue.hpp"
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Create empty table", "[integration]" ) {
|
||||
Script* script = Script::Create("table = {}");
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
#include "../../src/UserData/UserData.hpp"
|
||||
#include "../../src/UserData/UserDataStorage.hpp"
|
||||
#include "../../src/UserData/UserDataValue.hpp"
|
||||
using namespace Porygon;
|
||||
using namespace Porygon::UserData;
|
||||
using namespace Porygon::Utilities;
|
||||
|
||||
class UserDataTestObject{
|
||||
public:
|
||||
@@ -18,8 +21,8 @@ public:
|
||||
((UserDataTestObject*)obj)->foo = val->EvaluateInteger();
|
||||
}
|
||||
|
||||
static UserData* CreateData(){
|
||||
return new UserData({
|
||||
static Porygon::UserData::UserData* CreateData(){
|
||||
return new Porygon::UserData::UserData({
|
||||
{
|
||||
HashedString::ConstHash("foo"),
|
||||
new UserDataField(new NumericScriptType(true, false), GetFoo, SetFoo)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Create script variable", "[integration]" ) {
|
||||
Script* script = Script::Create("foo = true");
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <codecvt>
|
||||
#include <locale>
|
||||
#include "../../src/Parser/Lexer.hpp"
|
||||
using namespace Porygon::Parser;
|
||||
|
||||
TEST_CASE( "When at end of script return terminator", "[lexer]" ) {
|
||||
Lexer lexer = Lexer(u"", nullptr);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "../../src/Parser/Parser.hpp"
|
||||
using namespace Porygon::Parser;
|
||||
|
||||
TEST_CASE( "Parse single true keyword", "[parser]" ) {
|
||||
vector<const IToken*> v {new SimpleToken(TokenKind::TrueKeyword,0,0), new SimpleToken(TokenKind::EndOfFile,0,0)};
|
||||
|
||||
Reference in New Issue
Block a user