DSLTestCase catch cached script not proceeding error

This commit is contained in:
2023-07-17 11:36:51 -06:00
parent 963ef06196
commit 552d3978e4
8 changed files with 23 additions and 10 deletions

2
.gitignore vendored
View File

@@ -1 +1 @@
DSLScript*.json
AsyncDSLScript*.json

View File

@@ -0,0 +1,3 @@
{goop (cc)}
{gloop (cc)}
{(set wholeScriptDone true) (cc)}

View File

@@ -0,0 +1,3 @@
{goop (cc)}
{gloop (cc)}
{(set wholeScriptDone true) (cc)}

View File

@@ -1,4 +1,5 @@
// TODO make a better position reification scheme here
(defReaderMacro "goop" [stream] `(Assert.isTrue true))
(defReaderMacro "gloop" [stream] `(Assert.isFalse false))
(prop &mut wholeScriptDone false)
(prop Assert utest.Assert)

View File

@@ -1,2 +1,3 @@
goop
gloop
gloop
(set wholeScriptDone true)

View File

@@ -1,2 +0,0 @@
goop
gloop

View File

@@ -8,7 +8,9 @@ import kiss.Prelude;
class DSLTestCase extends Test {
function testScript() {
new DSLScript().run();
var script = new DSLScript();
script.run();
Assert.isTrue(script.wholeScriptDone);
}
function testFork() {
@@ -19,24 +21,29 @@ class DSLTestCase extends Test {
var script = new AsyncDSLScript();
script.run();
Assert.isFalse(script.ranHscriptInstruction);
Assert.isTrue(script.wholeScriptDone);
}
function testAsyncFromCache() {
var script = new AsyncDSLScriptThatWillCache();
script.run();
var script2 = new AsyncDSLScriptThatWillCache2();
script2.run();
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"))
class DSLScript extends EmbeddedScript {}
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "DSLScript.dsl"))
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScript.dsl"))
class AsyncDSLScript extends AsyncEmbeddedScript {}
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "DSLScriptThatWillCache.dsl"))
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScriptThatWillCache.dsl"))
class AsyncDSLScriptThatWillCache extends AsyncEmbeddedScript {}
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "DSLScriptThatWillCache.dsl"))
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScriptThatWillCache.dsl"))
class AsyncDSLScriptThatWillCache2 extends AsyncEmbeddedScript {}

View File

@@ -15,8 +15,8 @@ elif [ "$KISS_TARGET" = nodejs ]; then
lix install haxelib:hxnodejs
fi
if [ -e DSLScript.cache.json ]; then
rm DSLScript*.json
if [ -e AsyncDSLScript.cache.json ]; then
rm AsyncDSLScript*.json
fi
if [ ! -z "$2" ]; then