@@ -113,52 +113,52 @@ export class ExpressionTests {
113113 }
114114
115115 @TestCase ( "~a" , "bit.bnot(a);" )
116- @TestCase ( "a&b" , "bit.band(a,b);" )
117- @TestCase ( "a&=b" , "a = ( bit.band(a,b) );" )
118- @TestCase ( "a|b" , "bit.bor(a,b);" )
119- @TestCase ( "a|=b" , "a = ( bit.bor(a,b) );" )
120- @TestCase ( "a^b" , "bit.bxor(a,b);" )
121- @TestCase ( "a^=b" , "a = ( bit.bxor(a,b) );" )
122- @TestCase ( "a<<b" , "bit.lshift(a,b);" )
123- @TestCase ( "a<<=b" , "a = ( bit.lshift(a,b) );" )
124- @TestCase ( "a>>b" , "bit.rshift(a,b);" )
125- @TestCase ( "a>>=b" , "a = ( bit.rshift(a,b) );" )
126- @TestCase ( "a>>>b" , "bit.arshift(a,b);" )
127- @TestCase ( "a>>>=b" , "a = ( bit.arshift(a,b) );" )
116+ @TestCase ( "a&b" , "bit.band(a, b);" )
117+ @TestCase ( "a&=b" , "a = bit.band(a, b );" )
118+ @TestCase ( "a|b" , "bit.bor(a, b);" )
119+ @TestCase ( "a|=b" , "a = bit.bor(a, b );" )
120+ @TestCase ( "a^b" , "bit.bxor(a, b);" )
121+ @TestCase ( "a^=b" , "a = bit.bxor(a, b );" )
122+ @TestCase ( "a<<b" , "bit.lshift(a, b);" )
123+ @TestCase ( "a<<=b" , "a = bit.lshift(a, b );" )
124+ @TestCase ( "a>>b" , "bit.rshift(a, b);" )
125+ @TestCase ( "a>>=b" , "a = bit.rshift(a, b );" )
126+ @TestCase ( "a>>>b" , "bit.arshift(a, b);" )
127+ @TestCase ( "a>>>=b" , "a = bit.arshift(a, b );" )
128128 @Test ( "Bitop [JIT]" )
129129 public bitOperatorOverrideJIT ( input : string , lua : string ) : void {
130130 Expect ( util . transpileString ( input , { luaTarget : LuaTarget . LuaJIT , luaLibImport : "none" } ) ) . toBe ( lua ) ;
131131 }
132132
133133 @TestCase ( "~a" , "bit32.bnot(a);" )
134- @TestCase ( "a&b" , "bit32.band(a,b);" )
135- @TestCase ( "a&=b" , "a = ( bit32.band(a,b) );" )
136- @TestCase ( "a|b" , "bit32.bor(a,b);" )
137- @TestCase ( "a|=b" , "a = ( bit32.bor(a,b) );" )
138- @TestCase ( "a^b" , "bit32.bxor(a,b);" )
139- @TestCase ( "a^=b" , "a = ( bit32.bxor(a,b) );" )
140- @TestCase ( "a<<b" , "bit32.lshift(a,b);" )
141- @TestCase ( "a<<=b" , "a = ( bit32.lshift(a,b) );" )
142- @TestCase ( "a>>b" , "bit32.rshift(a,b);" )
143- @TestCase ( "a>>=b" , "a = ( bit32.rshift(a,b) );" )
144- @TestCase ( "a>>>b" , "bit32.arshift(a,b);" )
145- @TestCase ( "a>>>=b" , "a = ( bit32.arshift(a,b) );" )
134+ @TestCase ( "a&b" , "bit32.band(a, b);" )
135+ @TestCase ( "a&=b" , "a = bit32.band(a, b );" )
136+ @TestCase ( "a|b" , "bit32.bor(a, b);" )
137+ @TestCase ( "a|=b" , "a = bit32.bor(a, b );" )
138+ @TestCase ( "a^b" , "bit32.bxor(a, b);" )
139+ @TestCase ( "a^=b" , "a = bit32.bxor(a, b );" )
140+ @TestCase ( "a<<b" , "bit32.lshift(a, b);" )
141+ @TestCase ( "a<<=b" , "a = bit32.lshift(a, b );" )
142+ @TestCase ( "a>>b" , "bit32.rshift(a, b);" )
143+ @TestCase ( "a>>=b" , "a = bit32.rshift(a, b );" )
144+ @TestCase ( "a>>>b" , "bit32.arshift(a, b);" )
145+ @TestCase ( "a>>>=b" , "a = bit32.arshift(a, b );" )
146146 @Test ( "Bitop [5.2]" )
147147 public bitOperatorOverride52 ( input : string , lua : string ) : void {
148148 Expect ( util . transpileString ( input , { luaTarget : LuaTarget . Lua52 , luaLibImport : "none" } ) ) . toBe ( lua ) ;
149149 }
150150
151151 @TestCase ( "~a" , "~a;" )
152152 @TestCase ( "a&b" , "a & b;" )
153- @TestCase ( "a&=b" , "a = ( a & b) ;" )
153+ @TestCase ( "a&=b" , "a = a & b;" )
154154 @TestCase ( "a|b" , "a | b;" )
155- @TestCase ( "a|=b" , "a = ( a | b) ;" )
155+ @TestCase ( "a|=b" , "a = a | b;" )
156156 @TestCase ( "a^b" , "a ~ b;" )
157- @TestCase ( "a^=b" , "a = ( a ~ b) ;" )
157+ @TestCase ( "a^=b" , "a = a ~ b;" )
158158 @TestCase ( "a<<b" , "a << b;" )
159- @TestCase ( "a<<=b" , "a = ( a << b) ;" )
159+ @TestCase ( "a<<=b" , "a = a << b;" )
160160 @TestCase ( "a>>b" , "a >> b;" )
161- @TestCase ( "a>>=b" , "a = ( a >> b) ;" )
161+ @TestCase ( "a>>=b" , "a = a >> b;" )
162162 @Test ( "Bitop [5.3]" )
163163 public bitOperatorOverride53 ( input : string , lua : string ) : void {
164164 Expect ( util . transpileString ( input , { luaTarget : LuaTarget . Lua53 , luaLibImport : "none" } ) ) . toBe ( lua ) ;
0 commit comments