X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fok%2Fops.as;h=9f14136c68942f066888f5cbdded8513a2e85e75;hb=0f1baaeab21e4bfd0c48e8d0d025bf8a15ccbc2c;hp=642ea12d77cec64f72176f1d5c823dcc05f1f298;hpb=407b8ca88100e22f7dad6963ae49f75624b967cd;p=swftools.git diff --git a/lib/as3/ok/ops.as b/lib/as3/ok/ops.as index 642ea12..9f14136 100644 --- a/lib/as3/ok/ops.as +++ b/lib/as3/ok/ops.as @@ -3,7 +3,7 @@ package { import flash.display.MovieClip public class Main extends flash.display.MovieClip { var count:int = 1; - var num:int = 27; + var num:int = 30; function assert(b:Boolean) { if(b) { trace("ok "+count+"/"+num); @@ -39,6 +39,13 @@ package { assert(2+3==5); assert(2-3==-1); + /* test or */ + var y = 0; + var x = y || 1; + assert(x); + var z = x && 1; + assert(z); + /* test not */ trace("[not]"); assert(!false); @@ -57,6 +64,8 @@ package { assert((0xff ^ 0x55) == 0xaa); assert((1 & ~1) == 0); assert((1|~1)==~0); + + assert((1|2|4|8|16|32|64|128) == 0xff); /* test shift operations */ trace("[shift operations]"); @@ -76,6 +85,8 @@ package { /* test comma */ trace("[comma]"); assert( (1,2,3,4) == 4); + + trace("[exit]"); } } }