Skip to content

Commit

Permalink
Add test making sure Cargo.toml version matches the git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nbigaouette committed Apr 16, 2019
1 parent 1e1b12a commit 8a57e6f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,20 @@ pub fn python_shim(

shim::run(&interpreter_to_use, command, arguments)
}

#[cfg(test)]
mod tests {

#[test]
fn version() {
let crate_version = structopt::clap::crate_version!();

// GIT_VERSION is of the shape `v0.1.7-1-g095d7f5-modified`

// Strip out the `v` prefix
let (v, git_version_without_v) = crate::GIT_VERSION.split_at(1);

assert_eq!(v, "v");
assert!(git_version_without_v.starts_with(crate_version));
}
}

0 comments on commit 8a57e6f

Please sign in to comment.