3 import flash.display.MovieClip
5 public class Main extends flash.display.MovieClip {
10 function assert(b:Boolean) {
12 trace("ok "+count+"/"+num);
14 trace("error "+count+"/"+num);
23 /* test that assignment expressions do indeed return the
25 x = (y=1); assert(x==1 && y==1); //x=1;y=1;
26 x = (y++); assert(x==1 && y==2); //x=1;y=2;
27 x = (y--); assert(x==2 && y==1); //x=2;y=1;
28 x = (++y); assert(x==2 && y==2); //x=2;y=2;
29 x = (--y); assert(x==1 && y==1); //x=1;y=1;
30 x = (y += 1);assert(x==2 && y==2); //x=2;y=2;
31 x = (y -= 1);assert(x==1 && y==1); //x=1;y=1;
32 x = y = 5; assert(x==5 && y==5); //x=5;y=5;
35 x = (y*=5); assert(x==25 && y==25);
36 x = (y%=7); assert(x==4 && y==4);
37 x = (y<<=1); assert(x==8 && y==8);
38 x = (y>>=1); assert(x==4 && y==4);
39 x = (y>>>=1); assert(x==2 && y==2);
41 x = (y/=2); assert(x==1 && y==1);
43 x |= 0x0f; assert(x==0x5f);
55 /* nested assignment expressions need different temporary
56 registers- make sure they don't collide */
62 assert(a==11 && b==10 && c==8 && d==5);