DSLTestCase catch cached script not proceeding error
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1 @@
|
|||||||
DSLScript*.json
|
AsyncDSLScript*.json
|
||||||
3
src/test/cases/AsyncDSLScript.dsl
Normal file
3
src/test/cases/AsyncDSLScript.dsl
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{goop (cc)}
|
||||||
|
{gloop (cc)}
|
||||||
|
{(set wholeScriptDone true) (cc)}
|
||||||
3
src/test/cases/AsyncDSLScriptThatWillCache.dsl
Normal file
3
src/test/cases/AsyncDSLScriptThatWillCache.dsl
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{goop (cc)}
|
||||||
|
{gloop (cc)}
|
||||||
|
{(set wholeScriptDone true) (cc)}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
// TODO make a better position reification scheme here
|
// TODO make a better position reification scheme here
|
||||||
(defReaderMacro "goop" [stream] `(Assert.isTrue true))
|
(defReaderMacro "goop" [stream] `(Assert.isTrue true))
|
||||||
(defReaderMacro "gloop" [stream] `(Assert.isFalse false))
|
(defReaderMacro "gloop" [stream] `(Assert.isFalse false))
|
||||||
|
(prop &mut wholeScriptDone false)
|
||||||
(prop Assert utest.Assert)
|
(prop Assert utest.Assert)
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
goop
|
goop
|
||||||
gloop
|
gloop
|
||||||
|
(set wholeScriptDone true)
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
goop
|
|
||||||
gloop
|
|
||||||
@@ -8,7 +8,9 @@ import kiss.Prelude;
|
|||||||
|
|
||||||
class DSLTestCase extends Test {
|
class DSLTestCase extends Test {
|
||||||
function testScript() {
|
function testScript() {
|
||||||
new DSLScript().run();
|
var script = new DSLScript();
|
||||||
|
script.run();
|
||||||
|
Assert.isTrue(script.wholeScriptDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testFork() {
|
function testFork() {
|
||||||
@@ -19,24 +21,29 @@ class DSLTestCase extends Test {
|
|||||||
var script = new AsyncDSLScript();
|
var script = new AsyncDSLScript();
|
||||||
script.run();
|
script.run();
|
||||||
Assert.isFalse(script.ranHscriptInstruction);
|
Assert.isFalse(script.ranHscriptInstruction);
|
||||||
|
Assert.isTrue(script.wholeScriptDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testAsyncFromCache() {
|
function testAsyncFromCache() {
|
||||||
var script = new AsyncDSLScriptThatWillCache();
|
var script = new AsyncDSLScriptThatWillCache();
|
||||||
script.run();
|
script.run();
|
||||||
var script2 = new AsyncDSLScriptThatWillCache2();
|
var script2 = new AsyncDSLScriptThatWillCache2();
|
||||||
|
script2.run();
|
||||||
Assert.isTrue(script.ranHscriptInstruction || script2.ranHscriptInstruction);
|
Assert.isTrue(script.ranHscriptInstruction || script2.ranHscriptInstruction);
|
||||||
|
Assert.isFalse(script.ranHscriptInstruction && script2.ranHscriptInstruction);
|
||||||
|
Assert.isTrue(script.wholeScriptDone);
|
||||||
|
Assert.isTrue(script2.wholeScriptDone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@:build(kiss.EmbeddedScript.build("DSL.kiss", "DSLScript.dsl"))
|
@:build(kiss.EmbeddedScript.build("DSL.kiss", "DSLScript.dsl"))
|
||||||
class DSLScript extends EmbeddedScript {}
|
class DSLScript extends EmbeddedScript {}
|
||||||
|
|
||||||
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "DSLScript.dsl"))
|
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScript.dsl"))
|
||||||
class AsyncDSLScript extends AsyncEmbeddedScript {}
|
class AsyncDSLScript extends AsyncEmbeddedScript {}
|
||||||
|
|
||||||
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "DSLScriptThatWillCache.dsl"))
|
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScriptThatWillCache.dsl"))
|
||||||
class AsyncDSLScriptThatWillCache extends AsyncEmbeddedScript {}
|
class AsyncDSLScriptThatWillCache extends AsyncEmbeddedScript {}
|
||||||
|
|
||||||
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "DSLScriptThatWillCache.dsl"))
|
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScriptThatWillCache.dsl"))
|
||||||
class AsyncDSLScriptThatWillCache2 extends AsyncEmbeddedScript {}
|
class AsyncDSLScriptThatWillCache2 extends AsyncEmbeddedScript {}
|
||||||
4
test.sh
4
test.sh
@@ -15,8 +15,8 @@ elif [ "$KISS_TARGET" = nodejs ]; then
|
|||||||
lix install haxelib:hxnodejs
|
lix install haxelib:hxnodejs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e DSLScript.cache.json ]; then
|
if [ -e AsyncDSLScript.cache.json ]; then
|
||||||
rm DSLScript*.json
|
rm AsyncDSLScript*.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$2" ]; then
|
if [ ! -z "$2" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user