]> git.proxmox.com Git - cargo.git/commitdiff
Auto merge of #5752 - dwijnand:project_at, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 20 Jul 2018 16:42:57 +0000 (16:42 +0000)
committerbors <bors@rust-lang.org>
Fri, 20 Jul 2018 16:42:57 +0000 (16:42 +0000)
Remove the argument from the `project` test support function

By rewriting the tests, with rerast (https://github.com/google/rerast), to
use the newly introduced "at" method.

First I added the following temporary function to cargotest::support:

    pub fn project_foo() -> ProjectBuilder {
       project("foo")
    }

Then I defined the following rewrite.rs:

    use cargotest::support::{ project, project_foo };

    fn rule1(a: &'static str) {
       replace!(project("foo") => project_foo());
       replace!(project(a) => project_foo().at(a));
    }

Then I ran rerast:

    cargo +nightly rerast --rules_file=rewrite.rs --force --targets tests --file tests/testsuite/main.rs

Finally I searched and replaced the references to project_foo with
argument-less project (a little awkardly on macOS with a git clean).

    find tests -type f -exec sed -i -e 's/project_foo/project/g' {} +
    git clean -d tests

Fixes #5746


Trivial merge