Skip to content

Conversation

@geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Mar 19, 2025

Add a couple of test cases for data flow through conversions.

I was interested in the as case, which we do in fact get flow through so no code changes were necessary.

@geoffw0 geoffw0 added the Rust Pull requests that update Rust code label Mar 19, 2025
Copilot AI review requested due to automatic review settings March 19, 2025 18:16
Copy link
Contributor

Copilot AI left a 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 PR adds test cases in Rust for verifying data flow through type conversions without requiring changes to core library code.

  • Added function "conversions" with various conversion methods using the as, into, and i64::from conversions.
  • Updated the main function to invoke the new conversions test.
Files not reviewed (2)
  • rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected: Language not supported
  • rust/ql/test/library-tests/dataflow/local/inline-flow.expected: Language not supported

Tip: Leave feedback on Copilot's review comments with the 👎 and 👍 buttons to help improve review quality. Learn more

Copy link
Contributor

@paldepind paldepind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I assume that once we can write models directly for traits we'll want to write taint steps for From and Into.

Btw, I actually created the dataflow/modeled directory, thinking it should hold tests that are about things being modeled. But I never really made that intention clear to anyone. If you think it's nice to have such a division, we could do that going forward.

@geoffw0
Copy link
Contributor Author

geoffw0 commented Mar 25, 2025

I assume that once we can write models directly for traits we'll want to write taint steps for From and Into.

Very much yes.

Btw, I actually created the dataflow/modeled directory, thinking it should hold tests that are about things being modeled.

That's great, in practice we'll get coverage from query tests and some other data flow tests as well.

@geoffw0 geoffw0 merged commit 3ad4de4 into github:main Mar 25, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants