From d7216d5f932de42ea1fd7b8a35bd81c6729d3c07 Mon Sep 17 00:00:00 2001 From: Brandon Wallace Date: Thu, 19 Mar 2026 01:05:46 -0500 Subject: [PATCH] test: add failing tests for PPP variable-vs-variable comparison support Add 4 TDD tests for the var-vs-var comparison feature (S1-TT2): - test_cmd_if_var_vs_var_eq - test_cmd_if_var_vs_var_ne - test_cmd_if_var_vs_var_contains - test_cmd_if_var_vs_var_not_contains All tests fail because the grammar only accepts SIMPLEVALUE on RHS, not IDENTIFIER. Implementation in S1-T2 will make them pass. --- tests/tests.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/tests.py b/tests/tests.py index 7489c0d..b4b5a42 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -1328,6 +1328,43 @@ class TestPromptPostProcessor(TestPromptPostProcessorBase): ppp=self.nocupppp, ) + # Variable-vs-variable comparison tests + + def test_cmd_if_var_vs_var_eq(self): # var eq var: both set to same value, if-branch taken + self.process( + PromptPair( + "hellohelloYESNO", + "", + ), + PromptPair("YES", ""), + ) + + def test_cmd_if_var_vs_var_ne(self): # var ne var: different values, ne condition true + self.process( + PromptPair( + "appleorangeYESNO", + "", + ), + PromptPair("YES", ""), + ) + + def test_cmd_if_var_vs_var_contains(self): # var contains var: var1 contains var2's value + self.process( + PromptPair( + "hello worldhelloYESNO", + "", + ), + PromptPair("YES", ""), + ) + + def test_cmd_if_var_vs_var_not_contains(self): # var not contains var: var1 does not contain var2's value + self.process( + PromptPair( + "hello worldgoodbyeYESNO", + "", + ), + PromptPair("YES", ""), + ) if __name__ == "__main__": unittest.main()