Skip to content

Commit

Permalink
add tests for function class and function enum
Browse files Browse the repository at this point in the history
  • Loading branch information
philanderson888 committed Jan 10, 2025
1 parent c86ed13 commit 7e8ae0c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/Formatter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,38 @@ end sub`;
);
});

it('correctly indents function class modifiers', () => {
expect(formatter.format(
'function class()\nend function'
)).to.equal(
'function class()\nend function'
);
});

it('correctly indents function class modifiers with print statement', () => {
expect(formatter.format(
'function class()\nprint "hello"\nend function'
)).to.equal(
'function class()\n print "hello"\nend function'
);
});

it('correctly indents function enum modifiers', () => {
expect(formatter.format(
'function enum()\nend function'
)).to.equal(
'function enum()\nend function'
);
});

it('correctly indents function enum modifiers with print statement', () => {
expect(formatter.format(
'function enum()\nprint "hello"\nend function'
)).to.equal(
'function enum()\n print "hello"\nend function'
);
});

it('trims empty lines', () => {
expect(formatter.format(`sub a()\n \nend sub`)).to.equal(`sub a()\n\nend sub`);
});
Expand Down

0 comments on commit 7e8ae0c

Please sign in to comment.