Skip to content

Commit

Permalink
[Test] Add break statement test
Browse files Browse the repository at this point in the history
  • Loading branch information
Siubaak committed May 4, 2020
1 parent 5b169ef commit 525507c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/statement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ describe('testing src/index.ts', () => {
`)
})

it('should break statement in switch run normally', () => {
const interpreter = new Sval()
interpreter.run(`
exports.a = 0
while (exports.a < 10) {
exports.a++;
switch (2) {
case 2: break
}
}
`)
expect(interpreter.exports.a).toEqual(10)
})

it('should for-in statement run normally', () => {
const interpreter = new Sval()
interpreter.run(`
Expand Down

0 comments on commit 525507c

Please sign in to comment.