Compare commits
3 Commits
b2397945f0
...
bb25b4d382
| Author | SHA1 | Date | |
|---|---|---|---|
|
bb25b4d382
|
|||
|
9d1d4c997f
|
|||
|
3c9cb8bd73
|
@@ -404,16 +404,14 @@ mod tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn describe_fails_outside_repo() {
|
async fn describe_fails_outside_repo() {
|
||||||
let temp_dir = assert_fs::TempDir::new().unwrap();
|
|
||||||
|
|
||||||
// with_working_dir returns Err when not in a repo
|
// with_working_dir returns Err when not in a repo
|
||||||
|
let temp_dir = assert_fs::TempDir::new().unwrap();
|
||||||
let executor = JjLib::with_working_dir(temp_dir.path()).await;
|
let executor = JjLib::with_working_dir(temp_dir.path()).await;
|
||||||
assert!(executor.is_err());
|
assert!(executor.is_err());
|
||||||
|
|
||||||
// Use an executor from a valid repo and try to describe a non-existent revset
|
let valid_dir = assert_fs::TempDir::new().unwrap();
|
||||||
let executor = JjLib::with_working_dir(std::path::Path::new("."))
|
init_jj_repo(valid_dir.path()).await.expect("Failed to init jj repo");
|
||||||
.await
|
let executor = JjLib::with_working_dir(valid_dir.path()).await.unwrap();
|
||||||
.unwrap();
|
|
||||||
let result = executor
|
let result = executor
|
||||||
.describe("this-bookmark-does-not-exist", "test: should fail")
|
.describe("this-bookmark-does-not-exist", "test: should fail")
|
||||||
.await;
|
.await;
|
||||||
@@ -528,9 +526,8 @@ mod tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jj_lib_implements_jj_executor_trait() {
|
async fn jj_lib_implements_jj_executor_trait() {
|
||||||
let lib = JjLib::with_working_dir(std::path::Path::new(".")).await;
|
fn assert_implements<T: JjExecutor>() {}
|
||||||
fn accepts_executor(_: impl JjExecutor) {}
|
assert_implements::<JjLib>();
|
||||||
accepts_executor(lib.unwrap());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mod user_config_paths_tests {
|
mod user_config_paths_tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user