@@ -4,10 +4,10 @@ import * as util from "../../util";
44test . each ( [
55 { inp : `"abc"` , out : `"abc"` } ,
66 { inp : "3" , out : "3" } ,
7- { inp : "[1,2,3]" , out : "{\n 1,\n 2,\n 3,\n }" } ,
7+ { inp : "[1,2,3]" , out : "{1, 2, 3 }" } ,
88 { inp : "true" , out : "true" } ,
99 { inp : "false" , out : "false" } ,
10- { inp : `{a:3,b:"4"}` , out : `{\n a = 3,\n b = "4",\n }` } ,
10+ { inp : `{a:3,b:"4"}` , out : `{a = 3, b = "4"}` } ,
1111] ) ( "Const assignment (%p)" , ( { inp, out } ) => {
1212 const lua = util . transpileString ( `const myvar = ${ inp } ` ) ;
1313 expect ( lua ) . toBe ( `local myvar = ${ out } ` ) ;
@@ -16,10 +16,10 @@ test.each([
1616test . each ( [
1717 { inp : `"abc"` , out : `"abc"` } ,
1818 { inp : "3" , out : "3" } ,
19- { inp : "[1,2,3]" , out : "{\n 1,\n 2,\n 3,\n }" } ,
19+ { inp : "[1,2,3]" , out : "{1, 2, 3 }" } ,
2020 { inp : "true" , out : "true" } ,
2121 { inp : "false" , out : "false" } ,
22- { inp : `{a:3,b:"4"}` , out : `{\n a = 3,\n b = "4",\n }` } ,
22+ { inp : `{a:3,b:"4"}` , out : `{a = 3, b = "4"}` } ,
2323] ) ( "Let assignment (%p)" , ( { inp, out } ) => {
2424 const lua = util . transpileString ( `let myvar = ${ inp } ` ) ;
2525 expect ( lua ) . toBe ( `local myvar = ${ out } ` ) ;
@@ -28,10 +28,10 @@ test.each([
2828test . each ( [
2929 { inp : `"abc"` , out : `"abc"` } ,
3030 { inp : "3" , out : "3" } ,
31- { inp : "[1,2,3]" , out : "{\n 1,\n 2,\n 3,\n }" } ,
31+ { inp : "[1,2,3]" , out : "{1, 2, 3 }" } ,
3232 { inp : "true" , out : "true" } ,
3333 { inp : "false" , out : "false" } ,
34- { inp : `{a:3,b:"4"}` , out : `{\n a = 3,\n b = "4",\n }` } ,
34+ { inp : `{a:3,b:"4"}` , out : `{a = 3, b = "4"}` } ,
3535] ) ( "Var assignment (%p)" , ( { inp, out } ) => {
3636 const lua = util . transpileString ( `var myvar = ${ inp } ` ) ;
3737 expect ( lua ) . toBe ( `myvar = ${ out } ` ) ;
@@ -95,7 +95,7 @@ test("TupleReturn Single assignment", () => {
9595 ` ;
9696
9797 const lua = util . transpileString ( code ) ;
98- expect ( lua ) . toBe ( "local a = ({abc()})\na = ({abc()})" ) ;
98+ expect ( lua ) . toBe ( "local a = ({\n abc()\n })\na = ({\n abc()\n })" ) ;
9999} ) ;
100100
101101test ( "TupleReturn interface assignment" , ( ) => {
0 commit comments