From: Matthias Kramm Date: Sat, 14 Mar 2009 19:59:21 +0000 (+0100) Subject: added more tests X-Git-Tag: release-0-9-0~64 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=18b8ab0d7614dceda8836fe3bc50df7cbb41d85a;p=swftools.git added more tests --- diff --git a/lib/as3/ok/compareseq.as b/lib/as3/ok/compareseq.as new file mode 100644 index 0000000..ea61782 --- /dev/null +++ b/lib/as3/ok/compareseq.as @@ -0,0 +1,42 @@ +package { + import flash.display.MovieClip + + public class Main extends flash.display.MovieClip { + + var count:int = 1; + var num:int = 16; + + function istrue(b:Boolean) { + if(b) { + trace("ok "+count+"/"+num); + } else { + trace("error "+count+"/"+num); + } + count = count + 1 + } + function isfalse(b:Boolean) { + istrue(!b); + } + + function Main() { + trace("ok"); + + istrue(1 < 2 < 3); + isfalse(2 < 1 < 3); + isfalse(3 < 2 < 1); + isfalse(1 < 3 < 2); + isfalse(2 < 3 < 1); + isfalse(3 < 1 < 2); + + isfalse(1 > 2 > 3); + isfalse(2 > 1 > 3); + istrue(3 > 2 > 1); + isfalse(1 > 3 > 2); + isfalse(2 > 3 > 1); + isfalse(3 > 1 > 2); + + trace("[exit]"); + } + } +} + diff --git a/lib/as3/ok/extendclass.as b/lib/as3/ok/extendclass.as new file mode 100644 index 0000000..a6e5288 --- /dev/null +++ b/lib/as3/ok/extendclass.as @@ -0,0 +1,20 @@ + +/* I can't make this work with Flash 10, with any compiler. + + Error: Error #2136: The SWF file extendclass.swf + contains invalid data. +*/ + +package { + + import flash.display.MovieClip + + public class Main extends flash.display.MovieClip { + function Main() { + var p = new ExtendMain(); + } + } + + public class ExtendMain extends Main { + } +} diff --git a/lib/as3/ok/innerfunctionslots.as b/lib/as3/ok/innerfunctionslots.as new file mode 100644 index 0000000..5326e2a --- /dev/null +++ b/lib/as3/ok/innerfunctionslots.as @@ -0,0 +1,20 @@ +package { + import flash.display.MovieClip + import flash.events.Event + + public class Main extends flash.display.MovieClip { + public function test(e:Event) { + if(e.type instanceof String) { + trace("ok"); + } + + function inner(x:String) { + trace(e.type); + } + } + public function Main() { + var e = new Event(""); + test(e); + } + } +}