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