|
15 | 15 | str(name)
|
16 | 16 | for name in [
|
17 | 17 | pathlib.Path("examples") / "demo" / "2-teacher.pdl", # TODO: check why
|
| 18 | + pathlib.Path("examples") / "talk" / "8-tools.pdl", # TODO: check why |
18 | 19 | pathlib.Path("examples") / "talk" / "11-sdg.pdl", # TODO: check why
|
19 | 20 | pathlib.Path("examples") / "teacher" / "teacher.pdl", # TODO: check why
|
20 |
| - pathlib.Path("examples") / "demo" / "3-weather.pdl", |
| 21 | + pathlib.Path("examples") / "tools" / "calc.pdl", # TODO: check why |
21 | 22 | pathlib.Path("examples") / "tutorial" / "calling_apis.pdl",
|
22 | 23 | pathlib.Path("examples") / "cldk" / "cldk-assistant.pdl",
|
23 |
| - pathlib.Path("examples") / "weather" / "weather.pdl", |
24 | 24 | pathlib.Path("examples") / "talk" / "10-multi-agent.pdl",
|
25 | 25 | pathlib.Path("examples") / "gsm8k" / "gsmhard-bugs.pdl",
|
26 | 26 | pathlib.Path("examples") / "gsm8k" / "math-base.pdl",
|
|
38 | 38 | pathlib.Path("examples") / "granite" / "multi_round_chat.pdl",
|
39 | 39 | pathlib.Path("examples") / "granite" / "single_round_chat.pdl",
|
40 | 40 | pathlib.Path("examples") / "joke" / "Joke.pdl",
|
41 |
| - # pathlib.Path("examples") / "react" / "multi-agent.pdl", |
| 41 | + pathlib.Path("examples") / "react" / "multi-agent.pdl", |
42 | 42 | pathlib.Path("examples") / "talk" / "11-sdg.pdl",
|
43 | 43 | pathlib.Path("examples") / "talk" / "7-chatbot-roles.pdl",
|
| 44 | + pathlib.Path("examples") / "talk" / "8-tools.pdl", |
44 | 45 | pathlib.Path("examples") / "teacher" / "teacher.pdl",
|
| 46 | + pathlib.Path("examples") / "tools" / "calc.pdl", |
45 | 47 | pathlib.Path("examples") / "tutorial" / "include.pdl",
|
| 48 | + pathlib.Path("examples") / "hello" / "hello-roles-array.pdl", |
| 49 | + pathlib.Path("examples") / "weather" / "weather.pdl", |
| 50 | + pathlib.Path("examples") / "demo" / "3-weather.pdl", |
46 | 51 | ]
|
47 | 52 | }
|
48 | 53 |
|
@@ -83,6 +88,14 @@ class InputsType:
|
83 | 88 | pathlib.Path("examples")
|
84 | 89 | / "hello"
|
85 | 90 | / "hello-data.pdl": InputsType(scope={"something": "ABC"}),
|
| 91 | + pathlib.Path("examples") |
| 92 | + / "weather" |
| 93 | + / "weather.pdl": InputsType(stdin="What is the weather in Yorktown Heights?\n"), |
| 94 | + pathlib.Path("examples") |
| 95 | + / "demo" |
| 96 | + / "3-weather.pdl": InputsType( |
| 97 | + stdin="What is the weather in Yorktown Heights?\n" |
| 98 | + ), |
86 | 99 | }.items()
|
87 | 100 | }
|
88 | 101 |
|
@@ -134,9 +147,6 @@ def test_valid_programs(capsys, monkeypatch) -> None:
|
134 | 147 | wrong_results = {}
|
135 | 148 | for pdl_file_name in pathlib.Path(".").glob("**/*.pdl"):
|
136 | 149 | scope: ScopeType = {}
|
137 |
| - print(str(pdl_file_name)) |
138 |
| - # if "cldk" in str(pdl_file_name): |
139 |
| - # pass |
140 | 150 | if str(pdl_file_name) in TO_SKIP:
|
141 | 151 | continue
|
142 | 152 | if str(pdl_file_name) in TESTS_WITH_INPUT:
|
@@ -167,14 +177,16 @@ def test_valid_programs(capsys, monkeypatch) -> None:
|
167 | 177 | result_dir_name / result_file_name, "r", encoding="utf-8"
|
168 | 178 | ) as result_file:
|
169 | 179 | expected_result = str(result_file.read())
|
170 |
| - if str(result) != expected_result: |
| 180 | + if str(result).strip() != expected_result.strip(): |
171 | 181 | wrong_results[str(pdl_file_name)] = {
|
172 | 182 | "actual": str(result),
|
173 | 183 | "expected": str(expected_result),
|
174 | 184 | }
|
175 | 185 | except PDLParseError:
|
176 | 186 | actual_parse_error |= {str(pdl_file_name)}
|
177 |
| - except PDLRuntimeError: |
| 187 | + except PDLRuntimeError as exc: |
| 188 | + if str(pdl_file_name) not in set(str(p) for p in EXPECTED_RUNTIME_ERROR): |
| 189 | + print(exc) # unexpected error: breakpoint |
178 | 190 | actual_runtime_error |= {str(pdl_file_name)}
|
179 | 191 | # Parse errors
|
180 | 192 | expected_parse_error = set(str(p) for p in EXPECTED_PARSE_ERROR)
|
|
0 commit comments