From 41abdc96317672ec29f6c317d5961d159ad26cf2 Mon Sep 17 00:00:00 2001 From: marsninja Date: Fri, 23 Feb 2024 22:21:44 -0500 Subject: [PATCH] test: forget to turn the test into a test --- .../{another.jac => typed_filter_compr.jac} | 0 jaclang/tests/test_language.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) rename examples/micro/{another.jac => typed_filter_compr.jac} (100%) diff --git a/examples/micro/another.jac b/examples/micro/typed_filter_compr.jac similarity index 100% rename from examples/micro/another.jac rename to examples/micro/typed_filter_compr.jac diff --git a/jaclang/tests/test_language.py b/jaclang/tests/test_language.py index 7b2a5cb42..3dffe022b 100644 --- a/jaclang/tests/test_language.py +++ b/jaclang/tests/test_language.py @@ -323,3 +323,20 @@ def test_with_contexts(self) -> None: "{'apple': [1, 2, 3], 'banana': [1, 2, 3], 'cherry': [1, 2, 3]}", stdout_value, ) + + def test_typed_filter_compr(self) -> None: + """Parse micro jac file.""" + captured_output = io.StringIO() + sys.stdout = captured_output + jac_import( + "micro.typed_filter_compr", + base_path=self.fixture_abs_path("../../../examples/"), + ) + sys.stdout = sys.__stdout__ + stdout_value = captured_output.getvalue() + self.assertIn( + "[MyObj(a=0), MyObj2(a=2), MyObj(a=1), " + "MyObj2(a=3), MyObj(a=2), MyObj(a=3)]\n", + stdout_value, + ) + self.assertIn("[MyObj(a=0), MyObj(a=1), MyObj(a=2)]\n", stdout_value)