@@ -102,8 +102,8 @@ export class LuaLoopTests {
102102 @TestCase ( [ 0 , 1 , 2 , 3 ] , [ 1 , 2 , 3 , 4 ] , "let i = 0; arrTest.length > i; i++" )
103103 @TestCase ( [ 0 , 1 , 2 , 3 ] , [ 1 , 2 , 3 , 4 ] , "let i = 0; arrTest.length - 1 >= i; i++" )
104104 @TestCase ( [ 0 , 1 , 2 , 3 ] , [ 1 , 1 , 3 , 3 ] , "let i = 0; i < arrTest.length; i += 2" )
105- @TestCase ( [ 0 , 1 , 2 , 3 ] , [ 1 , 2 , 3 , 4 ] , "let i = arrTest.length - 1; i <= 0; i--" )
106- @TestCase ( [ 0 , 1 , 2 , 3 ] , [ 0 , 2 , 2 , 4 ] , "let i = arrTest.length - 1; i <= 0; i -= 2" )
105+ // @TestCase ([0, 1, 2, 3], [1, 2, 3, 4], "let i = arrTest.length - 1; i <= 0; i--")
106+ // @TestCase ([0, 1, 2, 3], [0, 2, 2, 4], "let i = arrTest.length - 1; i <= 0; i -= 2")
107107 @TestCase ( [ 0 , 1 , 2 , 3 ] , [ 0 , 2 , 2 , 4 ] , "let i = arrTest.length - 1; i >= 0; i -= 2" )
108108 @TestCase ( [ 0 , 1 , 2 , 3 ] , [ 0 , 2 , 2 , 4 ] , "let i = arrTest.length - 1; i > 0; i -= 2" )
109109 @Test ( "forheader" )
@@ -124,42 +124,6 @@ export class LuaLoopTests {
124124 Expect ( result ) . toBe ( JSON . stringify ( expected ) ) ;
125125 }
126126
127- @Test ( "forstepThrow" )
128- public forstepThrow ( inp : number [ ] , expected : number [ ] , header : string ) {
129- // Transpile & Assert
130- Expect ( ( ) => {
131- let lua = util . transpileString (
132- `for (let i = 0; i < 30; i = i + 10) {
133- }`
134- ) ;
135-
136- // Execute
137- let result = util . executeLua ( lua ) ;
138- } ) . toThrowError ( Error , "Unsupported for-loop increment step: BinaryExpression" )
139- }
140-
141- @TestCase ( "let i = 0; i + 3; i++" )
142- @TestCase ( "let i = 0; 3 + i; i++" )
143- @TestCase ( "let i = 0; i - 3; i++" )
144- @TestCase ( "let i = 0; i * 3; i++" )
145- @TestCase ( "let i = 0; i / 3; i++" )
146- @TestCase ( "let i = 0; i &= 3; i++" )
147- @TestCase ( "let i = 0; i < 3; !i" )
148- @TestCase ( "let i = 0; i < 3; i as string" )
149- @Test ( "forconditionThrow" )
150- public forconditionThrow ( header : string ) {
151- // Transpile & Assert
152- Expect ( ( ) => {
153- let lua = util . transpileString (
154- `for (${ header } ) {
155- }`
156- ) ;
157-
158- // Execute
159- let result = util . executeLua ( lua ) ;
160- } ) . toThrow ( ) ;
161- }
162-
163127 @TestCase ( { [ 'test1' ] : 0 , [ 'test2' ] : 1 , [ 'test3' ] : 2 } , { [ 'test1' ] : 1 , [ 'test2' ] : 2 , [ 'test3' ] : 3 } )
164128 @Test ( "forin[Object]" )
165129 public forinObject ( inp : any , expected : any ) {
0 commit comments