rust-lang / rust-lang/polonius

improve unit tests, add more

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.7k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Right now if you run cargo test, we will load the facts and run the borrow check algorithm, but we don't check it is "correct":

https://github.com/rust-lang-nursery/borrow-check/blob/8ef88dbe968db92dd9dfa0c0296c3c4a57608e0d/src/test.rs#L35-L37

I think what we want to do is to add the ability to support more than one algorithm for computing the output facts. Then we can test the "advanced" algorithms against the "naive" one, which is basically known to be correct.

Alternatively, we could just store "reference" facts.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/test.rs around lines 35-37 and running cargo test to understand the current fact-loading and borrow-check flow. Determine how correctness should be validated, either by comparing advanced algorithms with the naive algorithm or by using reference facts. Done means the tests detect incorrect output facts rather than only exercising execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing-qa
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.