Skip to content

Commit

Permalink
Extra tests for empty tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
Varg committed Sep 20, 2024
1 parent 4599dd9 commit 550010c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/tuples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ describe('tuples', () => {
expect(api.readVariable('%a')).toEqual([1]);
});

test('empty tuple with parenthesis', () => {
runTestFile(api, `a = 2 & %a = ()`);
expect(api.readVariable('%a')).toEqual([]);
});

test('empty tuple with brackets', () => {
runTestFile(api, `a = 2 & %a = []`);
expect(api.readVariable('%a')).toEqual([]);
});

test('nested tuple with single item', () => {
runTestFile(api, `%a = ("a", ["b"]) & %b = ("a", ("b"))`);
expect(api.readVariable('%a')).toEqual(['a', ['b']]);
Expand Down Expand Up @@ -147,7 +157,7 @@ describe('tuples', () => {
expect(api.readVariable('%rest')).toEqual([]);
});

test('swaping value without tmp variable', () => {
test('swapping value without tmp variable', () => {
runTestFile(
api,
`a = 1 & b = 2
Expand Down

0 comments on commit 550010c

Please sign in to comment.