fix: use actual function name in testing suggestion example (#855)#1033
Open
Mithra-J wants to merge 2 commits into
Open
fix: use actual function name in testing suggestion example (#855)#1033Mithra-J wants to merge 2 commits into
Mithra-J wants to merge 2 commits into
Conversation
…nGK#855) - Extract function names from submitted code using regex - Use first real function name in testing example (e.g. def test_greet) - Return None when no functions exist (e.g. one-liners like print()) - Frontend: skip diff block when example is null - Add 2 tests to verify behavior Fixes imDarshanGK#855
Owner
|
Please add a short demo (video/screenshot) showing only the feature working |
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.
Fix: Testing suggestion example now reflects actual code (#855)
Problem
The "Testing" suggestion always showed a hardcoded
def test_add()example regardless of the input code. For
print("Hello world"),this made results look completely unrelated to the actual input.
Root Cause
run_suggestionshad a static hardcoded string as theexamplefieldfor the Testing suggestion.
Fix
def test_greet)Nonewhen no functions exist — frontend skips the diff blockTests Added
test_testing_suggestion_no_example_for_no_functionstest_testing_suggestion_uses_actual_function_nameFixes #855