Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed Jan 22, 2025
1 parent 2dee637 commit 4794157
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Formatter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,28 @@ end sub`;
);
});

it('correctly indents function with try having contents', () => {
expect(formatter.format(`
function try
try
print "hello"
catch e
print "world"
end try
print "done"
end function
`)).to.equal(undent`
function try
try
print "hello"
catch e
print "world"
end try
print "done"
end 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 4794157

Please sign in to comment.