Skip to content

Commit

Permalink
Added conditional compile test
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed May 1, 2020
1 parent 63915e0 commit f45a8a4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/files/BrsFile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ describe('BrsFile', () => {

describe('conditional compile', () => {

it.only('works for upper case keywords', async () => {
let file = await program.addOrReplaceFile({ src: `${rootDir}/source/main.brs`, dest: 'source/main.brs' }, `
sub main()
#CONST someFlag = true
#IF someFlag
'code to execute when someFlag is true
#ELSEIF someFlag
'code to execute when anotherFlag is true
#ELSE
'code
#ENDIF
end sub
`);
expect(file.getDiagnostics()).to.be.lengthOf(0);
});

it('supports single-word #elseif and #endif', async () => {
let file = await program.addOrReplaceFile({ src: `${rootDir}/source/main.brs`, dest: 'source/main.brs' }, `
sub main()
Expand Down

0 comments on commit f45a8a4

Please sign in to comment.