Skip to content

Commit

Permalink
Add unit tests for #573
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed May 23, 2022
1 parent e13fca7 commit cf80835
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/files/BrsFile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@ describe('BrsFile', () => {
program.dispose();
});

describe('allowBrighterScriptInBrightScript', () => {
it('is false by default', () => {
program.setFile('source/main.brs', `
namespace CustomApp
end namespace
`);
program.validate();
expectDiagnostics(program, [{
...DiagnosticMessages.bsFeatureNotSupportedInBrsFiles('namespace')
}]);
});

it('allows bs features in brs', () => {
program.options.allowBrighterScriptInBrightScript = true;
program.setFile('source/main.brs', `
namespace CustomApp
end namespace
`);
program.validate();
expectZeroDiagnostics(program);
});
});

it('supports the third parameter in CreateObject', () => {
program.setFile('source/main.brs', `
sub main()
Expand Down

0 comments on commit cf80835

Please sign in to comment.