Skip to content

Commit

Permalink
test: update workspace path in test case
Browse files Browse the repository at this point in the history
This test case was creating "workspace1" as a sub-directory of the
default workspace, which seems like a mistake.
  • Loading branch information
scott2000 committed Jul 26, 2024
1 parent 8eb1dca commit 4d8eee3
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions cli/tests/test_immutable_commits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,30 +136,31 @@ fn test_immutable_heads_set_to_working_copy() {
#[test]
fn test_new_wc_commit_when_wc_immutable_multi_workspace() {
let test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init"]);
test_env.jj_cmd_ok(test_env.env_root(), &["branch", "create", "main"]);
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
let repo_path = test_env.env_root().join("repo");
test_env.jj_cmd_ok(&repo_path, &["branch", "create", "main"]);
test_env.add_config(r#"revset-aliases."immutable_heads()" = "main""#);
test_env.jj_cmd_ok(test_env.env_root(), &["new", "-m=a"]);
test_env.jj_cmd_ok(test_env.env_root(), &["workspace", "add", "workspace1"]);
test_env.jj_cmd_ok(&repo_path, &["new", "-m=a"]);
test_env.jj_cmd_ok(&repo_path, &["workspace", "add", "../workspace1"]);
let workspace1_envroot = test_env.env_root().join("workspace1");
test_env.jj_cmd_ok(workspace1_envroot.as_path(), &["edit", "default@"]);
let (_, stderr) = test_env.jj_cmd_ok(test_env.env_root(), &["branch", "set", "main"]);
test_env.jj_cmd_ok(&workspace1_envroot, &["edit", "default@"]);
let (_, stderr) = test_env.jj_cmd_ok(&repo_path, &["branch", "set", "main"]);
insta::assert_snapshot!(stderr, @r###"
Moved 1 branches to kkmpptxz 40cbbd52 main | a
Moved 1 branches to kkmpptxz 7796c4df main | (empty) a
Warning: The working-copy commit in workspace 'default' became immutable, so a new commit has been created on top of it.
Warning: The working-copy commit in workspace 'workspace1' became immutable, so a new commit has been created on top of it.
Working copy now at: royxmykx 5bcb7da6 (empty) (no description set)
Parent commit : kkmpptxz 40cbbd52 main | a
Working copy now at: royxmykx 896465c4 (empty) (no description set)
Parent commit : kkmpptxz 7796c4df main | (empty) a
"###);
test_env.jj_cmd_ok(workspace1_envroot.as_path(), &["workspace", "update-stale"]);
let (stdout, _) = test_env.jj_cmd_ok(workspace1_envroot.as_path(), &["log", "--no-graph"]);
test_env.jj_cmd_ok(&workspace1_envroot, &["workspace", "update-stale"]);
let (stdout, _) = test_env.jj_cmd_ok(&workspace1_envroot, &["log", "--no-graph"]);
insta::assert_snapshot!(stdout, @r###"
nppvrztz [email protected] 2001-02-03 08:05:11 workspace1@ 44082ceb
nppvrztz [email protected] 2001-02-03 08:05:11 workspace1@ ee0671fd
(empty) (no description set)
royxmykx [email protected] 2001-02-03 08:05:12 default@ 5bcb7da6
royxmykx [email protected] 2001-02-03 08:05:12 default@ 896465c4
(empty) (no description set)
kkmpptxz [email protected] 2001-02-03 08:05:12 main 40cbbd52
a
kkmpptxz [email protected] 2001-02-03 08:05:09 main 7796c4df
(empty) a
zzzzzzzz root() 00000000
"###);
}
Expand Down

0 comments on commit 4d8eee3

Please sign in to comment.