From e20e57ae6ed5c612202a56e583baddfe50a1a991 Mon Sep 17 00:00:00 2001 From: Max Ostrowski Date: Wed, 15 Apr 2026 13:54:54 +0200 Subject: [PATCH] add failed example for invalid warning --- .../statement_python_declared_output.expected.all | 1 + .../statement_python_declared_output.expected.none | 1 + tests/example/statement_python_declared_output.lp | 12 ++++++++++++ tests/test_encoding.py | 1 + 4 files changed, 15 insertions(+) create mode 100644 tests/example/statement_python_declared_output.expected.all create mode 100644 tests/example/statement_python_declared_output.expected.none create mode 100644 tests/example/statement_python_declared_output.lp diff --git a/tests/example/statement_python_declared_output.expected.all b/tests/example/statement_python_declared_output.expected.all new file mode 100644 index 00000000..50b96132 --- /dev/null +++ b/tests/example/statement_python_declared_output.expected.all @@ -0,0 +1 @@ +value(execution_output(test,"y"),val(int,3)) \ No newline at end of file diff --git a/tests/example/statement_python_declared_output.expected.none b/tests/example/statement_python_declared_output.expected.none new file mode 100644 index 00000000..34ec7b95 --- /dev/null +++ b/tests/example/statement_python_declared_output.expected.none @@ -0,0 +1 @@ +warning(variable(undeclared),(),((test,()),"y")) \ No newline at end of file diff --git a/tests/example/statement_python_declared_output.lp b/tests/example/statement_python_declared_output.lp new file mode 100644 index 00000000..79933d10 --- /dev/null +++ b/tests/example/statement_python_declared_output.lp @@ -0,0 +1,12 @@ +execution_declare(test, + statement_python("y = x + 1"), + ("x",()), + ("y",())). + +variable_declare(execution_input(test,"x"),fromFacts). +variable_domain(execution_input(test,"x"),val(int,2)). + +execution_run(test). + +#show value/2. +#show warning/3. \ No newline at end of file diff --git a/tests/test_encoding.py b/tests/test_encoding.py index 6496b709..2478d4bc 100644 --- a/tests/test_encoding.py +++ b/tests/test_encoding.py @@ -65,6 +65,7 @@ def run_test(name: str, engine: Literal["compile", "ground", "propagator"], chec "set_manipulations", "set_selfref", "strings", + "statement_python_declared_output", "sum_aggregates", "sum_chain_performance", "type_checking",