Skip to content

Commit

Permalink
Add stash_004 test
Browse files Browse the repository at this point in the history
  • Loading branch information
lusingander committed Aug 9, 2024
1 parent efdade2 commit bd173a0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,38 @@ fn stash_003() -> TestResult {
Ok(())
}

#[test]
fn stash_004() -> TestResult {
// Test case for multiple stashes for the same commit
let dir = tempfile::tempdir()?;
let repo_path = dir.path();

let git = &GitRepository::new(repo_path);

git.init();

git.commit("001", "2024-01-01");
git.commit("002", "2024-01-02");

git.stash("2024-02-01");
git.stash("2024-02-02");
git.stash("2024-02-03");

git.commit("003", "2024-03-01");

let options = &[
GenerateGraphOption::new("stash_004_chrono", graph::SortCommit::Chronological),
GenerateGraphOption::new("stash_004_topo", graph::SortCommit::Topological),
];

copy_git_dir(repo_path, "stash_004");

generate_and_output_graph_images(repo_path, options);
assert_graph_images(options);

Ok(())
}

#[test]
fn orphan_001() -> TestResult {
let dir = tempfile::tempdir()?;
Expand Down
Binary file added tests/graph/stash_004_chrono.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/graph/stash_004_topo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bd173a0

Please sign in to comment.