sulyi 1f40e3ef63 [jsinterp] Test suit update
- Fixes (at least changes) global variable referencing in `jsinterp2`
- Adds test suite based testcase for `jsinterp`
- Adds per assertion based skip
- Renames `test_jsinterp` (hopefully temporally) to `test_jsinterp_orig`
- Adds function declaration to testcases (code & ast)
2018-06-02 02:01:40 +02:00

22 lines
597 B
Python

from __future__ import unicode_literals
skip = {
'jsinterp': 'Unary opertations are not supported',
'parse': True
}
tests = [
{
'code': 'function f() { return -5 + +3; }',
'asserts': [{'value': -2, 'call': ('f',)}]
}, {
'code': 'function f() {return -5 + ++a;}',
'globals': {'a': -3},
'asserts': [{'value': -7, 'call': ('f',)}, {'value': -6, 'call': ('f',)}]
}, {
'code': 'function f() {return -5 + a++;}',
'globals': {'a': -3},
'asserts': [{'value': -8, 'call': ('f',)}, {'value': -7, 'call': ('f',)}]
}
]