jaclang 0.7.14__py3-none-any.whl → 0.7.17__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 +147 -77
- jaclang/cli/cmdreg.py +9 -12
- jaclang/compiler/__init__.py +19 -53
- jaclang/compiler/absyntree.py +94 -16
- jaclang/compiler/constant.py +8 -8
- jaclang/compiler/jac.lark +4 -3
- jaclang/compiler/parser.py +41 -25
- jaclang/compiler/passes/ir_pass.py +4 -13
- 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 +155 -54
- jaclang/compiler/passes/main/import_pass.py +99 -75
- jaclang/compiler/passes/main/py_collect_dep_pass.py +70 -0
- jaclang/compiler/passes/main/pyast_gen_pass.py +328 -565
- jaclang/compiler/passes/main/pyast_load_pass.py +33 -6
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +7 -0
- jaclang/compiler/passes/main/registry_pass.py +37 -3
- jaclang/compiler/passes/main/schedules.py +9 -2
- jaclang/compiler/passes/main/sym_tab_build_pass.py +10 -6
- jaclang/compiler/passes/main/tests/__init__.py +1 -1
- 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 +22 -5
- jaclang/compiler/passes/tool/jac_formatter_pass.py +135 -89
- jaclang/compiler/passes/tool/tests/fixtures/corelib.jac +37 -41
- jaclang/compiler/passes/tool/tests/fixtures/corelib_fmt.jac +37 -42
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/access_mod_check.jac +27 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/architype_test.jac +13 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/comment_alignment.jac +11 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/comments.jac +13 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/decorator_stack.jac +37 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/esc_keywords.jac +5 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/long_names.jac +19 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/triple_quoted_string.jac +6 -0
- jaclang/compiler/passes/tool/tests/test_jac_format_pass.py +11 -0
- jaclang/compiler/passes/tool/tests/test_unparse_validate.py +33 -39
- jaclang/compiler/passes/transform.py +4 -0
- jaclang/compiler/passes/utils/mypy_ast_build.py +45 -0
- jaclang/compiler/semtable.py +31 -7
- jaclang/compiler/symtable.py +16 -11
- jaclang/compiler/tests/test_importer.py +25 -10
- jaclang/langserve/engine.py +104 -118
- jaclang/langserve/sem_manager.py +379 -0
- jaclang/langserve/server.py +24 -11
- jaclang/langserve/tests/fixtures/base_module_structure.jac +27 -6
- jaclang/langserve/tests/fixtures/circle.jac +3 -3
- jaclang/langserve/tests/fixtures/circle_err.jac +3 -3
- jaclang/langserve/tests/fixtures/circle_pure.test.jac +3 -3
- jaclang/langserve/tests/fixtures/import_include_statements.jac +1 -1
- jaclang/langserve/tests/fixtures/rename.jac +30 -0
- jaclang/langserve/tests/test_sem_tokens.py +277 -0
- jaclang/langserve/tests/test_server.py +287 -17
- jaclang/langserve/utils.py +184 -98
- jaclang/plugin/builtin.py +1 -1
- jaclang/plugin/default.py +288 -92
- jaclang/plugin/feature.py +65 -27
- jaclang/plugin/spec.py +62 -23
- jaclang/plugin/tests/fixtures/other_root_access.jac +82 -0
- jaclang/plugin/tests/test_jaseci.py +414 -42
- jaclang/runtimelib/architype.py +650 -0
- jaclang/{core → runtimelib}/constructs.py +5 -8
- jaclang/{core → runtimelib}/context.py +86 -59
- jaclang/runtimelib/importer.py +361 -0
- jaclang/runtimelib/machine.py +158 -0
- jaclang/runtimelib/memory.py +158 -0
- jaclang/{core → runtimelib}/utils.py +30 -15
- jaclang/settings.py +5 -4
- jaclang/tests/fixtures/abc.jac +3 -3
- 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/baddy.test.jac +3 -0
- jaclang/tests/fixtures/bar.jac +34 -0
- jaclang/tests/fixtures/byllmissue.jac +1 -5
- jaclang/tests/fixtures/chandra_bugs2.jac +11 -10
- jaclang/tests/fixtures/cls_method.jac +41 -0
- jaclang/tests/fixtures/dblhello.jac +6 -0
- jaclang/tests/fixtures/deep/one_lev.jac +3 -3
- jaclang/tests/fixtures/deep/one_lev_dup.jac +2 -3
- jaclang/tests/fixtures/deep_import_mods.jac +13 -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/err.impl.jac +3 -0
- jaclang/tests/fixtures/err.jac +4 -2
- jaclang/tests/fixtures/err_runtime.jac +15 -0
- jaclang/tests/fixtures/foo.jac +43 -0
- jaclang/tests/fixtures/gendot_bubble_sort.jac +1 -1
- jaclang/tests/fixtures/hello.jac +4 -0
- jaclang/tests/fixtures/impl_grab.impl.jac +2 -1
- jaclang/tests/fixtures/impl_grab.jac +4 -1
- jaclang/tests/fixtures/import.jac +9 -0
- jaclang/tests/fixtures/index_slice.jac +30 -0
- jaclang/tests/fixtures/jp_importer_auto.jac +14 -0
- jaclang/tests/fixtures/maxfail_run_test.jac +4 -4
- jaclang/tests/fixtures/needs_import.jac +2 -2
- jaclang/tests/fixtures/pyfunc_1.py +1 -1
- jaclang/tests/fixtures/pyfunc_2.py +5 -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/fixtures/registry.jac +9 -0
- jaclang/tests/fixtures/run_test.jac +4 -4
- jaclang/tests/fixtures/semstr.jac +1 -4
- jaclang/tests/fixtures/simple_archs.jac +1 -1
- jaclang/tests/test_cli.py +109 -3
- jaclang/tests/test_language.py +170 -68
- jaclang/tests/test_reference.py +2 -3
- jaclang/utils/helpers.py +45 -21
- jaclang/utils/test.py +9 -0
- jaclang/utils/treeprinter.py +30 -7
- {jaclang-0.7.14.dist-info → jaclang-0.7.17.dist-info}/METADATA +3 -2
- {jaclang-0.7.14.dist-info → jaclang-0.7.17.dist-info}/RECORD +126 -90
- jaclang/core/architype.py +0 -502
- jaclang/core/importer.py +0 -344
- jaclang/core/memory.py +0 -99
- jaclang/tests/fixtures/aott_raise.jac +0 -25
- jaclang/tests/fixtures/package_import.jac +0 -6
- /jaclang/{core → runtimelib}/__init__.py +0 -0
- /jaclang/{core → runtimelib}/test.py +0 -0
- {jaclang-0.7.14.dist-info → jaclang-0.7.17.dist-info}/WHEEL +0 -0
- {jaclang-0.7.14.dist-info → jaclang-0.7.17.dist-info}/entry_points.txt +0 -0
jaclang/tests/fixtures/err.jac
CHANGED
|
@@ -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/hello.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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import from math { sin as s, cos, sqrt as sq }
|
|
2
|
+
include random;
|
|
3
|
+
import from ..test_cli, JacCliTests as Jac;
|
|
4
|
+
import from deep.mycode, code as c;
|
|
5
|
+
import hashcheck as h, assign_compr as a;
|
|
6
|
+
import from jacsamp, my_print as m;
|
|
7
|
+
|
|
8
|
+
with entry {
|
|
9
|
+
print(sq(4), s(30), cos(30));
|
|
10
|
+
print(randint(1, 10));
|
|
11
|
+
print(m("--->my_print<---"));
|
|
12
|
+
print(h.a, a.mvar);
|
|
13
|
+
print(c());
|
|
14
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
glob x = 5, y = 2;
|
|
2
2
|
|
|
3
3
|
test a {
|
|
4
|
-
check
|
|
4
|
+
check almostEqual(5, x);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
test b {
|
|
8
|
-
check
|
|
8
|
+
check "l" in "llm";
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
test c {
|
|
12
|
-
check
|
|
12
|
+
check x - y == 3;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
test d {
|
|
16
|
-
check
|
|
16
|
+
check 1 == 2;
|
|
17
17
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import:py os;
|
|
4
4
|
import:py pyfunc;
|
|
5
5
|
import:py random;
|
|
6
|
-
import:py from pyfunc
|
|
6
|
+
import:py from pyfunc { my_print }
|
|
7
7
|
|
|
8
8
|
with entry {
|
|
9
9
|
my_print(pyfunc);
|
|
@@ -11,7 +11,7 @@ with entry {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
import:py circle_pysolo;
|
|
14
|
-
import:py from circle_pysolo
|
|
14
|
+
import:py from circle_pysolo { calculate_area }
|
|
15
15
|
|
|
16
16
|
with entry {
|
|
17
17
|
print(f"are {calculate_area(2.0)}");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
# flake8: noqa
|
|
2
4
|
|
|
3
5
|
"""Python function for testing py imports."""
|
|
4
6
|
|
|
5
|
-
from __future__ import annotations
|
|
6
|
-
|
|
7
7
|
|
|
8
8
|
def count_up_to(n: int):
|
|
9
9
|
"""Count up to n"""
|
|
@@ -277,3 +277,6 @@ def foo() -> None:
|
|
|
277
277
|
|
|
278
278
|
|
|
279
279
|
foo()
|
|
280
|
+
|
|
281
|
+
node = 90
|
|
282
|
+
print(node)
|
|
File without changes
|
|
@@ -24,6 +24,15 @@ glob personality_examples: 'Personality Information of Famous People': dict[str,
|
|
|
24
24
|
|
|
25
25
|
glob person_value : list[tuple[dict[str, Personality], int]] =(-90);
|
|
26
26
|
|
|
27
|
+
can 'GenAI ability'
|
|
28
|
+
genai_ability(x: 'Something': str) -> 'Something Else': str by llm();
|
|
29
|
+
|
|
30
|
+
can 'Normal ability'
|
|
31
|
+
normal_ability(x: 'Something': str) -> 'Something Else': str {
|
|
32
|
+
y = 10;
|
|
33
|
+
return x;
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
can foo() {
|
|
28
37
|
person_value=22;
|
|
29
38
|
can bar() {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
glob a = 5, b = 2;
|
|
2
2
|
|
|
3
3
|
test t1 {
|
|
4
|
-
check
|
|
4
|
+
check almostEqual(a, 6);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
test t2 {
|
|
8
|
-
check
|
|
8
|
+
check a != b;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
test t3 {
|
|
12
|
-
check
|
|
12
|
+
check "d" in "abc";
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
test t4 {
|
|
16
|
-
check
|
|
16
|
+
check a - b == 3;
|
|
17
17
|
}
|
|
@@ -27,7 +27,4 @@ journal {
|
|
|
27
27
|
can add() -> 'no of': int {}
|
|
28
28
|
|
|
29
29
|
can 'update user mood'
|
|
30
|
-
updateMood(* mood: 'Moo of the Person': str, something:'Something':str, something_else: 'Something Else': int = 5, without_semstr: float) -> 'mood selection': str {}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
can get_personality (person: 'Person Object': list[Person]) -> 'Personality of the Person': dict[Personality, PersonalityIndex] by llm(reason=True, incl_info=(personality_examples, self.diary_entries));
|
|
30
|
+
updateMood(* mood: 'Moo of the Person': str, something:'Something':str, something_else: 'Something Else': int = 5, without_semstr: float) -> 'mood selection': str {}
|
jaclang/tests/test_cli.py
CHANGED
|
@@ -5,6 +5,7 @@ import io
|
|
|
5
5
|
import os
|
|
6
6
|
import subprocess
|
|
7
7
|
import sys
|
|
8
|
+
import traceback
|
|
8
9
|
|
|
9
10
|
from jaclang.cli import cli
|
|
10
11
|
from jaclang.plugin.builtin import dotgen
|
|
@@ -38,7 +39,7 @@ class JacCliTests(TestCase):
|
|
|
38
39
|
sys.stderr = captured_output
|
|
39
40
|
|
|
40
41
|
try:
|
|
41
|
-
cli.enter(self.fixture_abs_path("err2.jac"), entrypoint="speak", args=[])
|
|
42
|
+
cli.enter(self.fixture_abs_path("err2.jac"), entrypoint="speak", args=[])
|
|
42
43
|
except Exception as e:
|
|
43
44
|
print(f"Error: {e}")
|
|
44
45
|
|
|
@@ -46,7 +47,66 @@ class JacCliTests(TestCase):
|
|
|
46
47
|
sys.stderr = sys.__stderr__
|
|
47
48
|
stdout_value = captured_output.getvalue()
|
|
48
49
|
# print(stdout_value)
|
|
49
|
-
self.assertIn("
|
|
50
|
+
self.assertIn("Error", stdout_value)
|
|
51
|
+
|
|
52
|
+
def test_jac_cli_alert_based_runtime_err(self) -> None:
|
|
53
|
+
"""Basic test for pass."""
|
|
54
|
+
captured_output = io.StringIO()
|
|
55
|
+
sys.stdout = captured_output
|
|
56
|
+
sys.stderr = captured_output
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
cli.run(self.fixture_abs_path("err_runtime.jac"))
|
|
60
|
+
except Exception as e:
|
|
61
|
+
print(f"Error: {e}")
|
|
62
|
+
|
|
63
|
+
sys.stdout = sys.__stdout__
|
|
64
|
+
sys.stderr = sys.__stderr__
|
|
65
|
+
|
|
66
|
+
expected_stdout_values = (
|
|
67
|
+
"Error: list index out of range",
|
|
68
|
+
" print(some_list[invalid_index]);",
|
|
69
|
+
" ^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
70
|
+
" at bar() ",
|
|
71
|
+
" at foo() ",
|
|
72
|
+
" at <module> ",
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
logger_capture = "\n".join([rec.message for rec in self.caplog.records])
|
|
76
|
+
for exp in expected_stdout_values:
|
|
77
|
+
self.assertIn(exp, logger_capture)
|
|
78
|
+
|
|
79
|
+
def test_jac_impl_err(self) -> None:
|
|
80
|
+
"""Basic test for pass."""
|
|
81
|
+
if "jaclang.tests.fixtures.err" in sys.modules:
|
|
82
|
+
del sys.modules["jaclang.tests.fixtures.err"]
|
|
83
|
+
captured_output = io.StringIO()
|
|
84
|
+
sys.stdout = captured_output
|
|
85
|
+
sys.stderr = captured_output
|
|
86
|
+
|
|
87
|
+
try:
|
|
88
|
+
cli.enter(self.fixture_abs_path("err.jac"), entrypoint="speak", args=[])
|
|
89
|
+
except Exception:
|
|
90
|
+
traceback.print_exc()
|
|
91
|
+
|
|
92
|
+
sys.stdout = sys.__stdout__
|
|
93
|
+
sys.stderr = sys.__stderr__
|
|
94
|
+
stdout_value = captured_output.getvalue()
|
|
95
|
+
# print(stdout_value)
|
|
96
|
+
path_to_file = self.fixture_abs_path("err.impl.jac")
|
|
97
|
+
self.assertIn(f'"{path_to_file}", line 2', stdout_value)
|
|
98
|
+
|
|
99
|
+
def test_jac_test_err(self) -> None:
|
|
100
|
+
"""Basic test for pass."""
|
|
101
|
+
captured_output = io.StringIO()
|
|
102
|
+
sys.stdout = captured_output
|
|
103
|
+
sys.stderr = captured_output
|
|
104
|
+
cli.test(self.fixture_abs_path("baddy.jac"))
|
|
105
|
+
sys.stdout = sys.__stdout__
|
|
106
|
+
sys.stderr = sys.__stderr__
|
|
107
|
+
stdout_value = captured_output.getvalue()
|
|
108
|
+
path_to_file = self.fixture_abs_path("baddy.test.jac")
|
|
109
|
+
self.assertIn(f'"{path_to_file}", line 2,', stdout_value)
|
|
50
110
|
|
|
51
111
|
def test_jac_ast_tool_pass_template(self) -> None:
|
|
52
112
|
"""Basic test for pass."""
|
|
@@ -84,6 +144,52 @@ class JacCliTests(TestCase):
|
|
|
84
144
|
stdout_value = captured_output.getvalue()
|
|
85
145
|
self.assertIn("+-- Token", stdout_value)
|
|
86
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
|
+
|
|
87
193
|
def test_ast_dotgen(self) -> None:
|
|
88
194
|
"""Testing for print AstTool."""
|
|
89
195
|
captured_output = io.StringIO()
|
|
@@ -102,7 +208,7 @@ class JacCliTests(TestCase):
|
|
|
102
208
|
cli.check(f"{self.fixture_abs_path('game1.jac')}")
|
|
103
209
|
sys.stdout = sys.__stdout__
|
|
104
210
|
stdout_value = captured_output.getvalue()
|
|
105
|
-
self.assertIn("Errors: 0, Warnings:
|
|
211
|
+
self.assertIn("Errors: 0, Warnings: 2", stdout_value)
|
|
106
212
|
|
|
107
213
|
def test_type_info(self) -> None:
|
|
108
214
|
"""Testing for type info inside the ast tool."""
|