-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Go: improve tests for varargs flow #21269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request reintroduces tests for varargs (variadic parameter) flow in Go that were previously reverted. The tests are being committed as a preparatory step for future implementation with proper post-update nodes and use-use flow.
Changes:
- Added new test suite
VarArgsWithExternalFlowto test variadic parameters with external flow models - Enhanced existing test suites (
VarArgsWithFunctionModelsandVarArgs) with new test cases for variadic output parameters - Improved parameter naming in
ExternalValueFlow/completetest.qlfor better clarity
Reviewed changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithFunctionModels/vendor/github.com/nonexistent/test/stub.go | Added FunctionWithVarArgsOutParameter stub for testing variadic output parameters |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithFunctionModels/main.go | Added test cases for variadic out parameters and helper function for test infrastructure |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithFunctionModels/go.mod | Updated Go version to 1.25 |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithFunctionModels/Flows.ql | Added data flow model for FunctionWithVarArgsOutParameter |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/vendor/modules.txt | Added vendor modules file for new test suite |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/vendor/github.com/nonexistent/test/stub.go | Added stub functions for testing external flow with varargs |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/main.go | Added comprehensive test cases for varargs with external flow models |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/go.mod | Added go.mod for new test suite with Go 1.25 |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/Flows.ql | Added query configuration for external flow tests |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/Flows.ext.yml | Added external flow models for summary, source, and sink models |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/Flows.expected | Added expected test results file |
| go/ql/test/library-tests/semmle/go/dataflow/VarArgs/main.go | Added test cases for variadic out parameters |
| go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/completetest.ql | Improved parameter naming from src to source and sink |
These tests were added in #18235 and #18275, but those two PRs were reverted in #18434. As a first step towards implementing them again now that we have proper post-update nodes and use-use flow I am committing these tests.