mirror of
https://github.com/devZoGok/gameBase.git
synced 2026-08-26 19:43:28 +00:00
1st failed test
This commit is contained in:
@@ -1 +1,12 @@
|
||||
#include "luaFields.h"
|
||||
|
||||
namespace gameBase{
|
||||
using namespace std;
|
||||
|
||||
string LuaTableField::toString(){
|
||||
return "";
|
||||
}
|
||||
|
||||
AbstractLuaField LuaTableField::operator[](string fieldName){
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -9,13 +9,13 @@ namespace gameBase{
|
||||
public:
|
||||
std::string name = "";
|
||||
protected:
|
||||
AbstractLuaField();
|
||||
std::string toString();
|
||||
AbstractLuaField(std::string n) : name(n){}
|
||||
virtual std::string toString(){return "";}
|
||||
};
|
||||
|
||||
class LuaTableField : public AbstractLuaField{
|
||||
public:
|
||||
LuaTableField();
|
||||
LuaTableField(std::string name) : AbstractLuaField(name){}
|
||||
std::string toString();
|
||||
AbstractLuaField operator[](std::string);
|
||||
private:
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#include "luaFieldsTest.h"
|
||||
#include "luaFields.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace gameBase{
|
||||
using namespace std;
|
||||
|
||||
void LuaFieldsTest::setUp(){
|
||||
}
|
||||
|
||||
@@ -8,5 +13,8 @@ namespace gameBase{
|
||||
}
|
||||
|
||||
void LuaFieldsTest::testTableToString(){
|
||||
string toStringRes = "table = {a = 1, b = 2.2, c = true, d = \"false\", e = {x = 20, y = {}}}";
|
||||
LuaTableField table("table");
|
||||
CPPUNIT_ASSERT(table.toString() == toStringRes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user