22 lines
596 B
Python
Raw Normal View History

2018-05-31 06:37:27 +02:00
from __future__ import unicode_literals
skip = {
2018-06-02 05:26:32 +02:00
'jsinterp': 'Unary operations 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',)}]
}
]