Skip to content

testsuite: explictly update the mtime when needed #13139

@ChrisDenton

Description

@ChrisDenton

Currently some tests use Project::change_file with an empty content string just to update the modified time of the file e.g.:

p.change_file("src/lib.rs", "");

However, updating a zero length file to be zero length isn't guaranteed to change the modified time (it might be a no-op). Cargo's tests should explicitly set the modified time using the new File::set_times API.

There are at least a couple of ways this could be done. An explicit method could be added and used in place of calling change_file with an empty string. Or else change_file (or the underlying FileBuilder) could be updated to always set the modified time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions