Skip to content

Commit 27c7d42

Browse files
committed
Added test for assigning tuple return to single variable
1 parent ac9e196 commit 27c7d42

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/unit/assignments.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Expect, Test, TestCase } from "alsatian";
1+
import { Expect, Test, TestCase, FocusTest } from "alsatian";
22
import { TranspileError } from "../../src/Transpiler";
33

44
import * as util from "../src/util";
@@ -84,6 +84,16 @@ export class AssignmentTests {
8484
Expect(lua).toBe("local a,b=abc()");
8585
}
8686

87+
@Test("TupleReturn Single assignment")
88+
public tupleReturnSingleAssignment() {
89+
const code = `/** !TupleReturn */\n`
90+
+ `declare function abc() { return [1,2,3]; }\n`
91+
+ `let a = abc();`;
92+
93+
const lua = util.transpileString(code);
94+
Expect(lua).toBe("local a = abc()");
95+
}
96+
8797
@Test("TupleReturn interface assignment")
8898
public tupleReturnInterface() {
8999
const code = `interface def {\n`

0 commit comments

Comments
 (0)