jaclang 0.7.16__py3-none-any.whl → 0.7.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jaclang might be problematic. Click here for more details.
- jaclang/cli/cli.py +140 -77
- jaclang/compiler/absyntree.py +9 -4
- jaclang/compiler/constant.py +8 -8
- jaclang/compiler/parser.py +10 -2
- jaclang/compiler/passes/main/__init__.py +1 -1
- jaclang/compiler/passes/main/access_modifier_pass.py +96 -147
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py +152 -50
- jaclang/compiler/passes/main/import_pass.py +88 -59
- jaclang/compiler/passes/main/py_collect_dep_pass.py +70 -0
- jaclang/compiler/passes/main/pyast_gen_pass.py +46 -6
- jaclang/compiler/passes/main/pyast_load_pass.py +1 -0
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +7 -0
- jaclang/compiler/passes/main/schedules.py +9 -2
- jaclang/compiler/passes/main/sym_tab_build_pass.py +9 -5
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.empty.impl.jac +0 -0
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/py_imp_test.jac +29 -0
- jaclang/compiler/passes/main/tests/fixtures/pygame_mock/__init__.py +3 -0
- jaclang/compiler/passes/main/tests/fixtures/pygame_mock/color.py +3 -0
- jaclang/compiler/passes/main/tests/fixtures/pygame_mock/constants.py +5 -0
- jaclang/compiler/passes/main/tests/fixtures/pygame_mock/display.py +2 -0
- jaclang/compiler/passes/main/tests/test_import_pass.py +72 -13
- jaclang/compiler/passes/main/type_check_pass.py +15 -5
- jaclang/compiler/passes/tool/jac_formatter_pass.py +13 -3
- jaclang/compiler/passes/tool/tests/fixtures/corelib.jac +37 -41
- jaclang/compiler/passes/tool/tests/fixtures/corelib_fmt.jac +37 -41
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/access_mod_check.jac +27 -0
- jaclang/compiler/passes/utils/mypy_ast_build.py +45 -0
- jaclang/compiler/symtable.py +16 -11
- jaclang/compiler/tests/test_importer.py +17 -9
- jaclang/langserve/engine.py +64 -16
- jaclang/langserve/server.py +16 -1
- jaclang/langserve/tests/fixtures/import_include_statements.jac +3 -3
- jaclang/langserve/tests/fixtures/rename.jac +30 -0
- jaclang/langserve/tests/test_server.py +224 -6
- jaclang/langserve/utils.py +28 -98
- jaclang/plugin/builtin.py +8 -4
- jaclang/plugin/default.py +86 -64
- jaclang/plugin/feature.py +13 -13
- jaclang/plugin/spec.py +10 -11
- jaclang/plugin/tests/fixtures/other_root_access.jac +82 -0
- jaclang/plugin/tests/test_jaseci.py +414 -42
- jaclang/runtimelib/architype.py +481 -333
- jaclang/runtimelib/constructs.py +5 -8
- jaclang/runtimelib/context.py +89 -69
- jaclang/runtimelib/importer.py +16 -15
- jaclang/runtimelib/machine.py +66 -2
- jaclang/runtimelib/memory.py +134 -75
- jaclang/runtimelib/utils.py +17 -10
- jaclang/settings.py +2 -4
- jaclang/tests/fixtures/access_checker.jac +12 -17
- jaclang/tests/fixtures/access_modifier.jac +88 -33
- jaclang/tests/fixtures/baddy.jac +3 -0
- jaclang/tests/fixtures/bar.jac +34 -0
- jaclang/tests/fixtures/builtin_dotgen.jac +1 -0
- jaclang/tests/fixtures/edge_node_walk.jac +1 -1
- jaclang/tests/fixtures/edge_ops.jac +1 -1
- jaclang/tests/fixtures/edges_walk.jac +1 -1
- jaclang/tests/fixtures/foo.jac +43 -0
- jaclang/tests/fixtures/game1.jac +1 -1
- jaclang/tests/fixtures/gendot_bubble_sort.jac +1 -1
- jaclang/tests/fixtures/import.jac +9 -0
- jaclang/tests/fixtures/index_slice.jac +30 -0
- jaclang/tests/fixtures/objref.jac +12 -0
- jaclang/tests/fixtures/pyfunc_1.py +1 -1
- jaclang/tests/fixtures/pyfunc_2.py +2 -2
- jaclang/tests/fixtures/pygame_mock/__init__.py +3 -0
- jaclang/tests/fixtures/pygame_mock/color.py +3 -0
- jaclang/tests/fixtures/pygame_mock/constants.py +5 -0
- jaclang/tests/fixtures/pygame_mock/display.py +2 -0
- jaclang/tests/fixtures/pygame_mock/inner/__init__.py +0 -0
- jaclang/tests/fixtures/pygame_mock/inner/iner_mod.py +2 -0
- jaclang/tests/test_cli.py +49 -6
- jaclang/tests/test_language.py +126 -80
- jaclang/tests/test_reference.py +2 -9
- jaclang/utils/treeprinter.py +30 -3
- {jaclang-0.7.16.dist-info → jaclang-0.7.18.dist-info}/METADATA +3 -1
- {jaclang-0.7.16.dist-info → jaclang-0.7.18.dist-info}/RECORD +81 -59
- /jaclang/tests/fixtures/{err.test.jac → baddy.test.jac} +0 -0
- {jaclang-0.7.16.dist-info → jaclang-0.7.18.dist-info}/WHEEL +0 -0
- {jaclang-0.7.16.dist-info → jaclang-0.7.18.dist-info}/entry_points.txt +0 -0
jaclang/settings.py
CHANGED
|
@@ -14,10 +14,8 @@ class Settings:
|
|
|
14
14
|
filter_sym_builtins: bool = True
|
|
15
15
|
ast_symbol_info_detailed: bool = False
|
|
16
16
|
pass_timer: bool = False
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
py_raise: bool = False
|
|
20
|
-
py_raise_deep: bool = False
|
|
17
|
+
collect_py_dep_debug: bool = False
|
|
18
|
+
print_py_raised_ast: bool = False
|
|
21
19
|
|
|
22
20
|
# Formatter configuration
|
|
23
21
|
max_line_length: int = 88
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return "private method";
|
|
9
|
-
}
|
|
10
|
-
can :priv overide_check() {
|
|
11
|
-
return "inside access_check";
|
|
12
|
-
}
|
|
13
|
-
glob :priv b=1;
|
|
14
|
-
glob :priv p=0;
|
|
1
|
+
|
|
2
|
+
obj :pub ModulePublObj {}
|
|
3
|
+
obj :priv ModulePrivObj {}
|
|
4
|
+
|
|
5
|
+
glob :pub module_publ_glob:int = 0;
|
|
6
|
+
glob :priv module_priv_glob:int = 0;
|
|
7
|
+
|
|
15
8
|
with entry {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
ModulePrivObj(); # <-- okey.
|
|
10
|
+
ModulePublObj(); # <-- okey.
|
|
11
|
+
|
|
12
|
+
module_publ_glob; # <-- okey.
|
|
13
|
+
module_priv_glob; # <-- okey.
|
|
19
14
|
}
|
|
@@ -1,49 +1,104 @@
|
|
|
1
1
|
include:jac access_checker;
|
|
2
|
-
obj Animal {
|
|
3
|
-
has :pub species: str;
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
3
|
+
obj SomeObj {
|
|
4
|
+
obj :pub InnerPublObj {}
|
|
5
|
+
obj :priv InnerPrivObj {}
|
|
6
|
+
obj :protect InnerProtObj {}
|
|
7
|
+
|
|
8
|
+
enum :pub InnerPublEnum { FOO = "FOO" }
|
|
9
|
+
enum :priv InnerPrivEnum { BAR = "BAR" }
|
|
10
|
+
enum :protect InnerProtEnum { BAZ = "BAZ" }
|
|
8
11
|
|
|
12
|
+
can :pub publ_ability() -> None {}
|
|
13
|
+
can :priv priv_ability() -> None {}
|
|
14
|
+
can :protect prot_ability() -> None {}
|
|
9
15
|
|
|
16
|
+
has :pub publ_attrib:int = 0;
|
|
17
|
+
has :priv priv_attrib:int = 0;
|
|
18
|
+
has :protect prot_attrib:int = 0;
|
|
10
19
|
}
|
|
11
20
|
|
|
12
|
-
obj Dog: Animal: {
|
|
13
|
-
has :pub breed: str;
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
obj BaseClass {
|
|
23
|
+
has :pub publ_attrib:int = 0;
|
|
24
|
+
has :priv priv_attrib:int = 0;
|
|
25
|
+
has :protect prot_attrib:int = 0;
|
|
19
26
|
|
|
20
|
-
can
|
|
21
|
-
|
|
27
|
+
can do_base() -> None {
|
|
28
|
+
self.publ_attrib; # <-- okey.
|
|
29
|
+
self.priv_attrib; # <-- okey.
|
|
30
|
+
self.prot_attrib; # <-- okey.
|
|
22
31
|
}
|
|
32
|
+
}
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
|
|
35
|
+
obj DrivedClass1 :BaseClass: {
|
|
36
|
+
can do_driv1() -> None {
|
|
37
|
+
self.publ_attrib; # <-- okey.
|
|
38
|
+
self.priv_attrib; # <-- not okey.
|
|
39
|
+
self.prot_attrib; # <-- okey.
|
|
26
40
|
}
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Check if the protect works from inherited chain.
|
|
45
|
+
obj DrivedClass2 :BaseClass: {
|
|
46
|
+
can do_driv2() -> None {
|
|
47
|
+
self.publ_attrib; # <-- okey.
|
|
48
|
+
self.priv_attrib; # <-- not okey.
|
|
49
|
+
self.prot_attrib; # <-- okey.
|
|
29
50
|
}
|
|
30
51
|
}
|
|
31
|
-
|
|
32
|
-
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
obj :pub Chain1 {
|
|
56
|
+
has :priv priv_val:int = 0; # <-- the private in the chain.
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
obj :pub Chain2 {
|
|
60
|
+
has :pub chain1:Chain1 = Chain1();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
obj :pub Chain3 {
|
|
64
|
+
has :pub chain2:Chain2 = Chain2();
|
|
33
65
|
}
|
|
34
|
-
|
|
66
|
+
|
|
67
|
+
|
|
35
68
|
with entry {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
69
|
+
SomeObj.InnerPublObj; # <-- okey.
|
|
70
|
+
SomeObj.InnerPrivObj; # <-- not okey.
|
|
71
|
+
SomeObj.InnerProtObj; # <-- not okey.
|
|
72
|
+
|
|
73
|
+
SomeObj.InnerPublEnum; # <-- okey.
|
|
74
|
+
SomeObj.InnerPrivEnum; # <-- not okey.
|
|
75
|
+
SomeObj.InnerProtEnum; # <-- not okey.
|
|
76
|
+
|
|
77
|
+
some_obj = SomeObj();
|
|
78
|
+
|
|
79
|
+
some_obj.InnerPublObj; # <-- okey.
|
|
80
|
+
some_obj.InnerPrivObj; # <-- not okey.
|
|
81
|
+
some_obj.InnerProtObj; # <-- not okey.
|
|
82
|
+
|
|
83
|
+
some_obj.InnerPublEnum; # <-- okey.
|
|
84
|
+
some_obj.InnerPrivEnum; # <-- not okey.
|
|
85
|
+
some_obj.InnerProtEnum; # <-- not okey.
|
|
86
|
+
|
|
87
|
+
some_obj.publ_attrib; # <-- okey.
|
|
88
|
+
some_obj.priv_attrib; # <-- not okey.
|
|
89
|
+
some_obj.prot_attrib; # <-- not okey.
|
|
90
|
+
|
|
91
|
+
some_obj.publ_ability(); # <-- okey.
|
|
92
|
+
some_obj.priv_ability(); # <-- not okey.
|
|
93
|
+
some_obj.prot_ability(); # <-- not okey.
|
|
94
|
+
|
|
95
|
+
chain3: Chain3 = Chain3();
|
|
96
|
+
chain3.chain2.chain1; # <-- okey.
|
|
97
|
+
chain3.chain2.chain1.priv_val; # <-- not okey.
|
|
98
|
+
|
|
99
|
+
access_checker.ModulePublObj(); # <-- okey.
|
|
100
|
+
access_checker.ModulePrivObj(); # <-- not okey.
|
|
101
|
+
|
|
102
|
+
access_checker.module_priv_glob; # <-- okey.
|
|
103
|
+
access_checker.module_priv_glob; # <-- not okey.
|
|
49
104
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Define a simple node type called `Item`
|
|
2
|
+
node Item {
|
|
3
|
+
has value: int = 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
# Define an edge type called `Link`
|
|
7
|
+
edge Link {}
|
|
8
|
+
|
|
9
|
+
# Define the `bar` walker
|
|
10
|
+
walker bar_walk {
|
|
11
|
+
has count: int = 0;
|
|
12
|
+
|
|
13
|
+
# Start walking from the root node or an Item node
|
|
14
|
+
can start with `root | Item entry {
|
|
15
|
+
here ++> Item();
|
|
16
|
+
if self.count < 5 {
|
|
17
|
+
visit [-->];
|
|
18
|
+
} else {
|
|
19
|
+
"Created 5 items." |> print;
|
|
20
|
+
disengage;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
# Walk over Item nodes and update their values
|
|
25
|
+
can walk with Item entry {
|
|
26
|
+
here.value = self.count;
|
|
27
|
+
f"Item value: {here.value}" |> print;
|
|
28
|
+
self.count += 1;
|
|
29
|
+
visit [-->] else {
|
|
30
|
+
"Finished walking over all items." |> print;
|
|
31
|
+
disengage;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -31,6 +31,7 @@ with entry{
|
|
|
31
31
|
print(d2.count('a(val')==19,d2.count('#F5E5FF')==2 ,'Edge1' not in d2,d2.count('GenericEdge')==42);
|
|
32
32
|
print(d3.count('a(val')==6,d3.count("GenericEdge")==5,d3.count('#F5E5FF')==1);
|
|
33
33
|
print(d4.count("a(val")==25,d4.count("GenericEdge")==66,d4.count('#FFF0F')==3);
|
|
34
|
+
print(d5.count("Edge1(val=6)")==2, d5.count("GenericEdge()")==24);
|
|
34
35
|
# print(l3<l2);
|
|
35
36
|
# print(d1);
|
|
36
37
|
# print(d2);
|
|
@@ -22,7 +22,7 @@ edge MyEdge {
|
|
|
22
22
|
for j=0 to j<3 by j+=1 {
|
|
23
23
|
end +:MyEdge:val=random.randint(1, 15), val2=random.randint(1, 5):+> node_a(value=j + 10);
|
|
24
24
|
}
|
|
25
|
-
print([(
|
|
25
|
+
print([(arch.val, arch.val2) for i in end.__jac__.edges if isinstance(arch := i.architype, MyEdge)]);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
for i=0 to i<3 by i+=1 {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import:py from jaclang.plugin.feature, JacFeature as Jac;
|
|
2
|
+
import:py from jaclang.runtimelib.machine, JacMachine;
|
|
3
|
+
import:jac from bar, bar_walk;
|
|
4
|
+
# Test runner to initialize the walker
|
|
5
|
+
|
|
6
|
+
can test_run {
|
|
7
|
+
# Print the loaded modules
|
|
8
|
+
modules = JacMachine.get().list_modules();
|
|
9
|
+
"Loaded Modules:" |> print;
|
|
10
|
+
for mod_name in modules {
|
|
11
|
+
f"Module: {mod_name}" |> print;
|
|
12
|
+
}
|
|
13
|
+
# Print walkers
|
|
14
|
+
walkers = JacMachine.get().list_walkers(mod_name);
|
|
15
|
+
if walkers {
|
|
16
|
+
f"Walkers in {mod_name}:" |> print;
|
|
17
|
+
for walker in walkers {
|
|
18
|
+
f" - Walker: {walker}" |> print;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
# Print nodes
|
|
22
|
+
nodes = JacMachine.get().list_nodes(mod_name);
|
|
23
|
+
if nodes {
|
|
24
|
+
f"Nodes in {mod_name}:" |> print;
|
|
25
|
+
for node in nodes {
|
|
26
|
+
f" - Node: {node}" |> print;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
# Print edges
|
|
30
|
+
edges = JacMachine.get().list_edges(mod_name);
|
|
31
|
+
if edges {
|
|
32
|
+
f"Edges in {mod_name}:" |> print;
|
|
33
|
+
for edge in edges {
|
|
34
|
+
f" - Edge: {edge}" |> print;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
root spawn bar_walk();
|
|
38
|
+
}
|
|
39
|
+
# Define the entry point to run the test
|
|
40
|
+
|
|
41
|
+
with entry {
|
|
42
|
+
test_run();
|
|
43
|
+
}
|
jaclang/tests/fixtures/game1.jac
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
obj fruit {
|
|
2
|
+
has name: str,
|
|
3
|
+
color: str;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
glob a: list[fruit] = [
|
|
7
|
+
fruit(name="apple", color="red"),
|
|
8
|
+
fruit(name="banana", color="yellow"),
|
|
9
|
+
fruit(name="grape", color="purple")
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
glob b: dict[str, fruit] = {
|
|
13
|
+
"a": fruit(name="apple", color="red"),
|
|
14
|
+
"b": fruit(name="banana", color="yellow"),
|
|
15
|
+
"c": fruit(name="grape", color="purple")
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
can foo(a: list[fruit]) -> list[fruit] {
|
|
19
|
+
return a[0:2];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
with entry {
|
|
23
|
+
fruit_1 = a[0];
|
|
24
|
+
clr_1 = a[0].color;
|
|
25
|
+
clr_1 = b["a"].color;
|
|
26
|
+
f_clr = foo(a);
|
|
27
|
+
f_clrw = foo(a)[0];
|
|
28
|
+
f_clrw2 = foo(a)[0:1][0].color;
|
|
29
|
+
# print(foo(a)[0].color);
|
|
30
|
+
}
|
|
File without changes
|
jaclang/tests/test_cli.py
CHANGED
|
@@ -98,17 +98,14 @@ class JacCliTests(TestCase):
|
|
|
98
98
|
|
|
99
99
|
def test_jac_test_err(self) -> None:
|
|
100
100
|
"""Basic test for pass."""
|
|
101
|
-
if "jaclang.tests.fixtures.err" in sys.modules:
|
|
102
|
-
del sys.modules["jaclang.tests.fixtures.err"]
|
|
103
101
|
captured_output = io.StringIO()
|
|
104
102
|
sys.stdout = captured_output
|
|
105
103
|
sys.stderr = captured_output
|
|
106
|
-
cli.test(self.fixture_abs_path("
|
|
104
|
+
cli.test(self.fixture_abs_path("baddy.jac"))
|
|
107
105
|
sys.stdout = sys.__stdout__
|
|
108
106
|
sys.stderr = sys.__stderr__
|
|
109
107
|
stdout_value = captured_output.getvalue()
|
|
110
|
-
|
|
111
|
-
path_to_file = self.fixture_abs_path("err.test.jac")
|
|
108
|
+
path_to_file = self.fixture_abs_path("baddy.test.jac")
|
|
112
109
|
self.assertIn(f'"{path_to_file}", line 2,', stdout_value)
|
|
113
110
|
|
|
114
111
|
def test_jac_ast_tool_pass_template(self) -> None:
|
|
@@ -147,6 +144,52 @@ class JacCliTests(TestCase):
|
|
|
147
144
|
stdout_value = captured_output.getvalue()
|
|
148
145
|
self.assertIn("+-- Token", stdout_value)
|
|
149
146
|
|
|
147
|
+
def test_import_mod_abs_path(self) -> None:
|
|
148
|
+
"""Testing for print AstTool."""
|
|
149
|
+
captured_output = io.StringIO()
|
|
150
|
+
sys.stdout = captured_output
|
|
151
|
+
|
|
152
|
+
cli.tool("ir", ["ast", f"{self.fixture_abs_path('import.jac')}"])
|
|
153
|
+
|
|
154
|
+
sys.stdout = sys.__stdout__
|
|
155
|
+
stdout_value = captured_output.getvalue()
|
|
156
|
+
self.assertRegex(
|
|
157
|
+
stdout_value,
|
|
158
|
+
r"1\:11 \- 1\:13.*ModulePath - os - abs_path\:.*typeshed/stdlib/os/__init__.pyi",
|
|
159
|
+
)
|
|
160
|
+
self.assertRegex(
|
|
161
|
+
stdout_value,
|
|
162
|
+
r"2\:11 \- 2\:14.*ModulePath - sys - abs_path\:.*typeshed/stdlib/sys/__init__.pyi",
|
|
163
|
+
)
|
|
164
|
+
self.assertRegex(
|
|
165
|
+
stdout_value,
|
|
166
|
+
r"3\:11 \- 3\:17.*ModulePath - pyfunc - abs_path\:.*fixtures/pyfunc.py",
|
|
167
|
+
)
|
|
168
|
+
self.assertRegex(
|
|
169
|
+
stdout_value,
|
|
170
|
+
r"4\:11 \- 4\:28.*ModulePath - pygame_mock - abs_path\:.*fixtures/pygame_mock/inner/__init__.py",
|
|
171
|
+
)
|
|
172
|
+
self.assertRegex(
|
|
173
|
+
stdout_value,
|
|
174
|
+
r"6\:11 \- 6\:15.*ModulePath - math - abs_path\:.*typeshed/stdlib/math.pyi",
|
|
175
|
+
)
|
|
176
|
+
self.assertRegex(
|
|
177
|
+
stdout_value,
|
|
178
|
+
r"7\:11 \- 7\:19.*ModulePath - argparse - abs_path\:.*typeshed/stdlib/argparse.pyi",
|
|
179
|
+
)
|
|
180
|
+
self.assertRegex(
|
|
181
|
+
stdout_value,
|
|
182
|
+
r"8\:16 \- 8\:27.*ModulePath - pygame_mock - abs_path\:.*fixtures/pygame_mock/__init__.py",
|
|
183
|
+
)
|
|
184
|
+
self.assertRegex(
|
|
185
|
+
stdout_value,
|
|
186
|
+
r"8\:30 \- 8:35.*ModuleItem - color - abs_path\:.*fixtures/pygame_mock/color.py",
|
|
187
|
+
)
|
|
188
|
+
self.assertRegex(
|
|
189
|
+
stdout_value,
|
|
190
|
+
r"8\:37 \- 8:44.*ModuleItem - display - abs_path\:.*fixtures/pygame_mock/display.py",
|
|
191
|
+
)
|
|
192
|
+
|
|
150
193
|
def test_ast_dotgen(self) -> None:
|
|
151
194
|
"""Testing for print AstTool."""
|
|
152
195
|
captured_output = io.StringIO()
|
|
@@ -165,7 +208,7 @@ class JacCliTests(TestCase):
|
|
|
165
208
|
cli.check(f"{self.fixture_abs_path('game1.jac')}")
|
|
166
209
|
sys.stdout = sys.__stdout__
|
|
167
210
|
stdout_value = captured_output.getvalue()
|
|
168
|
-
self.assertIn("Errors: 0, Warnings:
|
|
211
|
+
self.assertIn("Errors: 0, Warnings: 2", stdout_value)
|
|
169
212
|
|
|
170
213
|
def test_type_info(self) -> None:
|
|
171
214
|
"""Testing for type info inside the ast tool."""
|