Failing test case for #11
This commit is contained in:
25
src/test/cases/UnclosedMacroTestCase.hx
Normal file
25
src/test/cases/UnclosedMacroTestCase.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.EUnmatchedBracket("(")))
|
||||
class UnclosedMacroTestCase extends Test {
|
||||
function testSplitByAll() {
|
||||
Assert.pass();
|
||||
}
|
||||
|
||||
function testExpectedError() {
|
||||
_testExpectedError();
|
||||
}
|
||||
}
|
77
src/test/cases/UnclosedMacroTestCase.kiss
Normal file
77
src/test/cases/UnclosedMacroTestCase.kiss
Normal file
@@ -0,0 +1,77 @@
|
||||
(defMacro addSkips [flxMovieClass]
|
||||
`{
|
||||
(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