test: add coverage for graph queries and parser error paths (6 new tests)#38
Draft
github-actions[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
…sts) - test_find_action_invokers_returns_invoking_reasoning_action - test_get_topic_reasoning_actions_counts_correctly - test_get_topic_action_defs_counts_correctly - test_find_variable_writers_after_set_clause - test_find_usages_returns_all_incoming_edges_for_topic - test_parse_error_on_unknown_variable_type Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What gap was identified
Two areas with zero test coverage were identified:
Graph query methods —
src/graph/queries.rshas methodsfind_action_invokers,find_usages,find_variable_writers,get_topic_reasoning_actions, andget_topic_action_defswith no tests at all. The existing query tests only coveredfind_outgoing_transitions,find_incoming_transitions,topic_execution_order, andstats.Parser error paths — none of the test files contained a test that expected
parse_sourceto returnErr. All existing tests verified successful parses, leaving the error-reporting code paths untested.Files modified
src/graph/queries.rs— 5 new tests added to the existing#[cfg(test)] mod testsblocktests/integration_test.rs— 1 new test added to the existingmod parser_unit_testsblockNew tests
test_find_action_invokers_returns_invoking_reasoning_action@actions.lookupcreates anInvokesedge;find_action_invokers(lookup_def_idx)must return that reasoning actiontest_get_topic_reasoning_actions_counts_correctlyget_topic_reasoning_actions("topic_a")returns exactly the 1 reasoning action in that topic; returns empty for a leaf topic and for an unknown topic nametest_get_topic_action_defs_counts_correctlyget_topic_action_defs("main")returns exactly 2 defs for a topic with two action definitions; returns empty for an unknown topictest_find_variable_writers_after_set_clauseset@variables.step = 2creates aWritesedge;find_variable_writers(step_idx)must include that reasoning actiontest_find_usages_returns_all_incoming_edges_for_topicfind_usages(topic_b)returns all incoming edges (not filtered by type), distinguishing it fromfind_incoming_transitionstest_parse_error_on_unknown_variable_typeparse_sourcewith an unrecognized type keyword (notavalidtype) must returnErr— exercises the error-reporting path