mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 05:38:00 +00:00
42cac55be8
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
49 lines
1.2 KiB
Rust
49 lines
1.2 KiB
Rust
pub mod common;
|
|
|
|
use std::process::Command;
|
|
|
|
use assert_cmd::{cargo, prelude::*};
|
|
|
|
/// This test verifies that after cloning the LLVM repository, checking out a specific branch
|
|
/// or reference works as expected.
|
|
#[test]
|
|
fn checkout_after_clone() -> anyhow::Result<()> {
|
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
|
|
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
|
.current_dir(test_dir.path())
|
|
.arg("clone")
|
|
.assert()
|
|
.success();
|
|
|
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
|
.current_dir(test_dir.path())
|
|
.arg("checkout")
|
|
.assert()
|
|
.success();
|
|
|
|
Ok(())
|
|
}
|
|
|
|
/// This test verifies that after cloning the LLVM repository, checking out a specific branch
|
|
/// or reference with the `--force` option works as expected.
|
|
#[test]
|
|
fn force_checkout() -> anyhow::Result<()> {
|
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
|
|
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
|
.current_dir(test_dir.path())
|
|
.arg("clone")
|
|
.assert()
|
|
.success();
|
|
|
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
|
.current_dir(test_dir.path())
|
|
.arg("checkout")
|
|
.arg("--force")
|
|
.assert()
|
|
.success();
|
|
|
|
Ok(())
|
|
}
|