rocs/RocsCore
TestScriptEngine.cpp
Go to the documentation of this file.
78 engine->setScript(QString("var a = test.list_nodes()[0]; a.set_type(%1); a.type();").arg(type1), graphDoc);
83 engine->setScript(QString("var x = test.add_edge(test.list_nodes()[1], test.list_nodes()[2]); test.list_edges().length;"), graphDoc);
86 engine->setScript(QString("var x = test.list_edges()[1]; x.remove(); test.list_edges().length;"), graphDoc);
91 engine->setScript(QString("test.list_nodes()[0].remove(); test.list_nodes().length;"), graphDoc);
131 QVERIFY2(!result.toString().contains("Error"), "Comment was not ignored, script with syntax error was executed.");
133 QVERIFY2(!result.toString().contains("Error"), "Comment in file with processed includes was not ignored, script with syntax error was executed.");
137 QVERIFY2(!result.toString().contains("Error"), "Comment was not ignored, script with syntax error was executed.");
139 QVERIFY2(!result.toString().contains("Error"), "Comment in file with processed includes was not ignored, script with syntax error was executed.");
143 QVERIFY2(!result.toString().contains("Error"), "Comment was not ignored, script with syntax error was executed.");
145 QVERIFY2(!result.toString().contains("Error"), "Comment in file with processed includes was not ignored, script with syntax error was executed.");
149 QVERIFY2(!result.toString().contains("Error"), "Comment was not ignored, script with syntax error was executed.");
151 QVERIFY2(!result.toString().contains("Error"), "Comment in file with processed includes was not ignored, script with syntax error was executed.");
155 QVERIFY2(!result.toString().contains("Error"), "Comment was not ignored, script with syntax error was executed.");
157 QVERIFY2(!result.toString().contains("Error"), "Comment in file with processed includes was not ignored, script with syntax error was executed.");
int registerDataType(const QString &name, int identifier=0)
Register new type for data elements.
Definition: Document.cpp:124
Document * activeDocument() const
Returns the currently active document, or 0 if there document list is empty.
Definition: DocumentManager.cpp:96
QScriptValue evaluate(const QString &program, const QString &fileName, int lineNumber)
static DataStructurePtr create(Document *parent=0)
Definition: DataStructure.cpp:68
QString include(const QString &script, const QString &actualPath=QString(), const QString &filename=QString())
Definition: IncludeManager.cpp:51
QString toString() const
QString number(int n, int base)
DataStructurePtr addDataStructure(const QString &name=QString())
Add data structure to graph document with name name.
Definition: Document.cpp:333
DataStructurePtr activeDataStructure() const
Definition: Document.cpp:431
Definition: TestScriptEngine.h:23
void setActiveDataStructure(int index)
Sets the active data structure of graph document with index index in the data structure list...
Definition: Document.cpp:315
This class provides the script backend for script executions.
Definition: QtScriptBackend.h:40
IncludeManager & includeManager() const
Definition: QtScriptBackend.cpp:137
bool contains(QChar ch, Qt::CaseSensitivity cs) const
Definition: Document.h:41
void setScript(const QString &script, Document *document)
Set the script script and the corresponding document document to be executed on next run...
Definition: QtScriptBackend.cpp:257
void addDocument(Document *document)
Add document to document list and set this document as active document.
Definition: DocumentManager.cpp:106
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.