Skip to content

Commit 40d4916

Browse files
author
Yury Selivanov
committed
Add unittests
1 parent 4614b06 commit 40d4916

62 files changed

Lines changed: 1520 additions & 361 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Makefile‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: all test
2+
3+
all:
4+
npm install syntaxtest
5+
6+
test:
7+
./node_modules/.bin/syntaxtest --tests test/**/*.py --syntax MagicPython.YAML-tmLanguage

‎test/builtins/builtins1.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
AttributeError ConnectionAbortedError
2+
PendingDeprecationWarning
3+
SystemExit
4+
NotImplemented
5+
sum oct abs type object print
6+
7+
8+
9+
AttributeError : source.python, support.type.exception.python
10+
: source.python
11+
ConnectionAbortedError : source.python, support.type.exception.python
12+
PendingDeprecationWarning : source.python, support.type.exception.python
13+
SystemExit : source.python, support.type.exception.python
14+
NotImplemented : source.python, support.type.exception.python
15+
sum : source.python, support.function.builtin.python
16+
: source.python
17+
oct : source.python, support.type.python
18+
: source.python
19+
abs : source.python, support.function.builtin.python
20+
: source.python
21+
type : source.python, support.type.python
22+
: source.python
23+
object : source.python, support.type.python
24+
: source.python
25+
print : source.python, support.function.builtin.python

‎test/builtins/builtins2.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Error
2+
3+
4+
Error : source.python

‎test/calls/call1.py‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
some_call(A, b, c[1], *args, FOO=lambda:{'q': 42}, **kwargs)
2+
3+
4+
5+
some_call : meta.function-call.python, source.python
6+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
7+
A : constant.other.caps.python, meta.function-call.arguments.python, meta.function-call.python, source.python
8+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
9+
b : meta.function-call.arguments.python, meta.function-call.python, source.python
10+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
11+
: meta.function-call.arguments.python, meta.function-call.python, source.python
12+
c : meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, source.python
13+
[ : meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, punctuation.definition.arguments.begin.python, source.python
14+
1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.item-access.arguments.python, meta.item-access.python, source.python
15+
] : meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, punctuation.definition.arguments.end.python, source.python
16+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
17+
: meta.function-call.arguments.python, meta.function-call.python, source.python
18+
* : keyword.operator.python, meta.function-call.arguments.python, meta.function-call.python, source.python
19+
args : meta.function-call.arguments.python, meta.function-call.python, source.python
20+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
21+
: meta.function-call.arguments.python, meta.function-call.python, source.python
22+
FOO : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.pyhton
23+
= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python
24+
lambda : meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.function.lambda.python
25+
: : meta.function-call.arguments.python, meta.function-call.python, source.python
26+
{ : meta.function-call.arguments.python, meta.function-call.python, source.python
27+
' : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python
28+
q : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python
29+
' : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python
30+
: : meta.function-call.arguments.python, meta.function-call.python, source.python
31+
42 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python
32+
} : meta.function-call.arguments.python, meta.function-call.python, source.python
33+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
34+
: meta.function-call.arguments.python, meta.function-call.python, source.python
35+
** : keyword.operator.python, meta.function-call.arguments.python, meta.function-call.python, source.python
36+
kwargs : meta.function-call.arguments.python, meta.function-call.python, source.python
37+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python

‎test/calls/call2.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
foo(from=1)
2+
3+
4+
5+
foo : meta.function-call.python, source.python
6+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
7+
from : keyword.control.flow.python, meta.function-call.arguments.python, meta.function-call.python, source.python
8+
= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python
9+
1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python
10+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python

‎test/calls/call3.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
foo.class(a)
2+
foo.and()
3+
foo.if
4+
5+
6+
7+
foo. : source.python
8+
class : keyword.control.flow.python, meta.function-call.python, source.python
9+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
10+
a : meta.function-call.arguments.python, meta.function-call.python, source.python
11+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
12+
foo. : source.python
13+
and : keyword.control.flow.python, meta.function-call.python, source.python
14+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
15+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
16+
foo : source.python
17+
. : source.python
18+
if : keyword.control.flow.python, source.python
19+
: source.python

‎test/calls/print1.py‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
print "is", 2*2
2+
print("is", 2*2)
3+
print x,
4+
print(x, end=" ")
5+
print
6+
print()
7+
print >>sys.stderr, "er"
8+
print("er", file=sys.stderr)
9+
print (x, y)
10+
print((x, y))
11+
12+
13+
14+
print : source.python, support.function.builtin.python
15+
: source.python
16+
" : source.python, string.quoted.double.python
17+
is : source.python, string.quoted.double.python
18+
" : source.python, string.quoted.double.python
19+
, : source.python
20+
2 : constant.numeric.dec.python, source.python
21+
* : keyword.operator.python, source.python
22+
2 : constant.numeric.dec.python, source.python
23+
print : meta.function-call.python, source.python, support.function.builtin.python
24+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
25+
" : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
26+
is : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
27+
" : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
28+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
29+
: meta.function-call.arguments.python, meta.function-call.python, source.python
30+
2 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python
31+
* : keyword.operator.python, meta.function-call.arguments.python, meta.function-call.python, source.python
32+
2 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python
33+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
34+
print : source.python, support.function.builtin.python
35+
x, : source.python
36+
print : meta.function-call.python, source.python, support.function.builtin.python
37+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
38+
x : meta.function-call.arguments.python, meta.function-call.python, source.python
39+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
40+
: meta.function-call.arguments.python, meta.function-call.python, source.python
41+
end : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.pyhton
42+
= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python
43+
" : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
44+
: meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
45+
" : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
46+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
47+
print : source.python, support.function.builtin.python
48+
print : meta.function-call.python, source.python, support.function.builtin.python
49+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
50+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
51+
print : source.python, support.function.builtin.python
52+
: source.python
53+
>> : keyword.operator.python, source.python
54+
sys.stderr, : source.python
55+
" : source.python, string.quoted.double.python
56+
er : source.python, string.quoted.double.python
57+
" : source.python, string.quoted.double.python
58+
print : meta.function-call.python, source.python, support.function.builtin.python
59+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
60+
" : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
61+
er : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
62+
" : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.double.python
63+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
64+
: meta.function-call.arguments.python, meta.function-call.python, source.python
65+
file : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.pyhton
66+
= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python
67+
sys.stderr : meta.function-call.arguments.python, meta.function-call.python, source.python
68+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
69+
print : meta.function-call.python, source.python, support.function.builtin.python
70+
: meta.function-call.python, source.python
71+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
72+
x : meta.function-call.arguments.python, meta.function-call.python, source.python
73+
, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python
74+
y : meta.function-call.arguments.python, meta.function-call.python, source.python
75+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
76+
print : meta.function-call.python, source.python, support.function.builtin.python
77+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
78+
( : meta.function-call.arguments.python, meta.function-call.python, source.python
79+
x, y : meta.function-call.arguments.python, meta.function-call.python, source.python
80+
) : meta.function-call.arguments.python, meta.function-call.python, source.python
81+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python

‎test/classes/class1.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Foo -> None: pass
2+
3+
4+
5+
class : source.python, storage.type.class.python
6+
Foo : source.python
7+
-> : invalid.illegal.annotation.python, source.python
8+
: source.python
9+
None : constant.language.python, source.python
10+
: : source.python
11+
pass : keyword.control.flow.python, source.python

‎test/classes/class2.py‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@dec
2+
class Spam(Foo.Bar, Bar.name={'very': 'odd'}):
3+
pass
4+
5+
6+
@ : entity.name.function.decorator.python, meta.function.decorator.python, source.python
7+
dec : entity.name.function.decorator.python, meta.function.decorator.python, source.python
8+
class : meta.class.python, source.python, storage.type.class.python
9+
: meta.class.python, source.python
10+
Spam : entity.name.type.class.python, meta.class.python, source.python
11+
( : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.begin.python, source.python
12+
Foo : entity.other.inherited-class.pyhton, meta.class.inheritance.python, meta.class.python, source.python
13+
. : meta.class.inheritance.python, meta.class.python, source.python
14+
Bar : entity.other.inherited-class.pyhton, meta.class.inheritance.python, meta.class.python, source.python
15+
, : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python
16+
: meta.class.inheritance.python, meta.class.python, source.python
17+
Bar : entity.other.inherited-class.pyhton, meta.class.inheritance.python, meta.class.python, source.python
18+
. : meta.class.inheritance.python, meta.class.python, source.python
19+
name : entity.other.inherited-class.pyhton, meta.class.inheritance.python, meta.class.python, source.python
20+
= : keyword.operator.assignment.python, meta.class.inheritance.python, meta.class.python, source.python
21+
{ : meta.class.inheritance.python, meta.class.python, source.python
22+
' : meta.class.inheritance.python, meta.class.python, source.python, string.quoted.single.python
23+
very : meta.class.inheritance.python, meta.class.python, source.python, string.quoted.single.python
24+
' : meta.class.inheritance.python, meta.class.python, source.python, string.quoted.single.python
25+
: : meta.class.inheritance.python, meta.class.python, source.python
26+
' : meta.class.inheritance.python, meta.class.python, source.python, string.quoted.single.python
27+
odd : meta.class.inheritance.python, meta.class.python, source.python, string.quoted.single.python
28+
' : meta.class.inheritance.python, meta.class.python, source.python, string.quoted.single.python
29+
} : meta.class.inheritance.python, meta.class.python, source.python
30+
) : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.end.python, source.python
31+
: : meta.class.python, punctuation.section.class.begin.python, source.python
32+
: source.python
33+
pass : keyword.control.flow.python, source.python

‎test/classes/class3.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Spam(Foo, from=12):
2+
pass
3+
4+
5+
6+
class : meta.class.python, source.python, storage.type.class.python
7+
: meta.class.python, source.python
8+
Spam : entity.name.type.class.python, meta.class.python, source.python
9+
( : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.begin.python, source.python
10+
Foo : entity.other.inherited-class.pyhton, meta.class.inheritance.python, meta.class.python, source.python
11+
, : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python
12+
: meta.class.inheritance.python, meta.class.python, source.python
13+
from : keyword.control.flow.python, meta.class.inheritance.python, meta.class.python, source.python
14+
= : keyword.operator.assignment.python, meta.class.inheritance.python, meta.class.python, source.python
15+
12 : constant.numeric.dec.python, meta.class.inheritance.python, meta.class.python, source.python
16+
) : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.end.python, source.python
17+
: : meta.class.python, punctuation.section.class.begin.python, source.python
18+
: source.python
19+
pass : keyword.control.flow.python, source.python

0 commit comments

Comments
 (0)