simplify test case for #11 and also catch variant with function
This commit is contained in:
25
src/test/cases/UnclosedFunctionTestCase.hx
Normal file
25
src/test/cases/UnclosedFunctionTestCase.hx
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package test.cases;
|
||||||
|
|
||||||
|
import utest.Test;
|
||||||
|
import utest.Assert;
|
||||||
|
import kiss.Prelude;
|
||||||
|
import kiss.List;
|
||||||
|
import kiss.Stream;
|
||||||
|
import haxe.ds.Option;
|
||||||
|
import kiss.Kiss;
|
||||||
|
#if js
|
||||||
|
import js.lib.Promise;
|
||||||
|
#end
|
||||||
|
|
||||||
|
using StringTools;
|
||||||
|
|
||||||
|
@:build(kiss.Kiss.buildExpectingError(kiss.EType.EStream('Ran out of expressions before ) was found.')))
|
||||||
|
class UnclosedFunctionTestCase extends Test {
|
||||||
|
function testSplitByAll() {
|
||||||
|
Assert.pass();
|
||||||
|
}
|
||||||
|
|
||||||
|
function testExpectedError() {
|
||||||
|
_testExpectedError();
|
||||||
|
}
|
||||||
|
}
|
||||||
4
src/test/cases/UnclosedFunctionTestCase.kiss
Normal file
4
src/test/cases/UnclosedFunctionTestCase.kiss
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
(function addSkips [flxMovieClass]
|
||||||
|
{
|
||||||
|
(method &override :Void prepareForSkip []
|
||||||
|
})
|
||||||
@@ -13,7 +13,7 @@ import js.lib.Promise;
|
|||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
@:build(kiss.Kiss.buildExpectingError(kiss.EType.EUnmatchedBracket("(")))
|
@:build(kiss.Kiss.buildExpectingError(kiss.EType.EStream('Ran out of expressions before ) was found.')))
|
||||||
class UnclosedMacroTestCase extends Test {
|
class UnclosedMacroTestCase extends Test {
|
||||||
function testSplitByAll() {
|
function testSplitByAll() {
|
||||||
Assert.pass();
|
Assert.pass();
|
||||||
|
|||||||
@@ -1,77 +1,4 @@
|
|||||||
(defMacro addSkips [flxMovieClass]
|
(defMacro addSkips [flxMovieClass]
|
||||||
`{
|
{
|
||||||
(method &override :Void prepareForSkip []
|
(method &override :Void prepareForSkip []
|
||||||
(print "prepareForSkip override called")
|
|
||||||
// TODO these things could/should all be in HollywooDSL:
|
|
||||||
(kiss_tools.TimerWithPause.stopAll)
|
|
||||||
(flxDirector.pause)
|
|
||||||
(.clear (director.shortcutHandler))
|
|
||||||
(flxDirector.cleanup)
|
|
||||||
(cond
|
|
||||||
(~didLoading
|
|
||||||
(set skipMovie (new ,flxMovieClass flxDirector))
|
|
||||||
(skipMovie.scavengeObjects this)
|
|
||||||
(doCleanup))
|
|
||||||
(true
|
|
||||||
(set skipMovie ~this)))
|
|
||||||
|
|
||||||
(preload
|
|
||||||
(unless (FlxG.inputs.list.contains flxDirector.actionManager)
|
|
||||||
(FlxG.inputs.add flxDirector.actionManager))
|
|
||||||
|
|
||||||
(set onCommitLabel ->:Void label {
|
|
||||||
(FlxDirector.lastSceneForMovie this label)
|
|
||||||
}))
|
|
||||||
|
|
||||||
(cleanup
|
|
||||||
(when skipMovie?.running
|
|
||||||
(callPrivate skipMovie "doCleanup")))
|
|
||||||
|
|
||||||
(cleanup
|
|
||||||
(set tweens [])
|
|
||||||
(set flxDirector.nextCC null)
|
|
||||||
(loopingSoundPlays.clear)
|
|
||||||
(destroyAndClear actors)
|
|
||||||
(destroyAndClear props)
|
|
||||||
(destroyAndClear sets)
|
|
||||||
(destroyAndClear sounds)
|
|
||||||
(destroyAndClear voiceTracks)
|
|
||||||
(destroyAndClear songs)
|
|
||||||
(when (flixel.FlxG.cameras.list.contains uiCamera)
|
|
||||||
(flixel.FlxG.cameras.remove uiCamera true))
|
|
||||||
(when (flixel.FlxG.cameras.list.contains screenCamera)
|
|
||||||
(flixel.FlxG.cameras.remove screenCamera true))
|
|
||||||
|
|
||||||
// I hope this disposes of references to actors, props, sets, etc.:
|
|
||||||
(scenes.clear)
|
|
||||||
|
|
||||||
(propScales.m.clear)
|
|
||||||
(propsInScene.clear)
|
|
||||||
(overlaidPropsInScenes.clear)
|
|
||||||
(doFor m tweenedPositionsOfSpritesInScenes
|
|
||||||
(doFor p m
|
|
||||||
(p.put))
|
|
||||||
(m.clear))
|
|
||||||
(tweenedPositionsOfSpritesInScenes.clear)
|
|
||||||
|
|
||||||
(doFor =>key lightSourceList lightSources
|
|
||||||
(whileLet [lightSource (lightSourceList.elements.pop)]
|
|
||||||
(lightSource.destroy)))
|
|
||||||
|
|
||||||
(#when cpp
|
|
||||||
(cpp.vm.Gc.run true)
|
|
||||||
(cpp.vm.Gc.compact)))
|
|
||||||
|
|
||||||
(#when debug
|
|
||||||
(preload
|
|
||||||
(.registerItem (director.shortcutHandler) "[n]ext label"
|
|
||||||
->cc {
|
|
||||||
(prepareForSkip)
|
|
||||||
(runFromNextLabel skipMovie)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
(.registerItem (director.shortcutHandler) "skip to [l]abel"
|
|
||||||
->cc
|
|
||||||
(flxDirector.sceneSelection ->:Void {}))))
|
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user