summaryrefslogtreecommitdiffstats
path: root/sigcore/test/TestScript.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-25 11:27:22 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-25 11:27:22 -0500
commit63fdacbc25fbec6c44a9cd099273c74406b99de0 (patch)
treec7e75a10b20067f811e234d69505b294b9fad36d /sigcore/test/TestScript.cpp
parent1a95f514ee0ca435cb0c7ebaff22748cd3eba276 (diff)
downloadsigen-63fdacbc25fbec6c44a9cd099273c74406b99de0.tar.gz
sigen-63fdacbc25fbec6c44a9cd099273c74406b99de0.tar.xz
sigen-63fdacbc25fbec6c44a9cd099273c74406b99de0.zip
Added qtscript as a language for Kross in Script
Diffstat (limited to 'sigcore/test/TestScript.cpp')
-rw-r--r--sigcore/test/TestScript.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/sigcore/test/TestScript.cpp b/sigcore/test/TestScript.cpp
index 251adbf9..8498c499 100644
--- a/sigcore/test/TestScript.cpp
+++ b/sigcore/test/TestScript.cpp
@@ -182,6 +182,31 @@ connect(object, \"signal2()\", object, \"slot2()\")\n\
QCOMPARE(m_value, QString("set"));
}
+void TestScript::qtscript()
+{
+ Sigcore::Script script("qtscript", "object.value = \"set\"\n\
+function slot()\n\
+{\n\
+ object.slot1()\n\
+}\n\
+connect(object, \"signal1()\", this, slot)\n\
+connect(object, \"signal2()\", object, \"slot2()\")\n\
+");
+
+ m_action = new Kross::Action(this, "test-script");
+ m_action->setInterpreter(script.interpreter());
+ m_action->setCode(script.script().toUtf8());
+ m_action->addObject(this, "object");
+ m_action->trigger();
+
+ emit(signal1());
+ emit(signal2());
+
+ QCOMPARE(m_foo, true);
+ QCOMPARE(m_bar, true);
+ QCOMPARE(m_value, QString("set"));
+}
+
void java()
{
Sigcore::Script script("python", "import object\n\