Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cli/tests/test_describe_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use indoc::indoc;
use crate::common::CommandOutput;
use crate::common::TestEnvironment;
use crate::common::TestWorkDir;
use crate::common::force_interactive;

#[test]
fn test_describe() {
Expand Down Expand Up @@ -623,6 +624,29 @@ fn test_multiple_message_args() {
");
}

#[test]
fn test_describe_stdin_description() {
let test_env = TestEnvironment::default();
test_env.run_jj_in(".", ["git", "init", "repo"]).success();
let work_dir = test_env.work_dir("repo");
let output = work_dir.run_jj_with(|cmd| {
force_interactive(cmd)
.args(["describe", "--stdin"])
.write_stdin("first stdin\nsecond stdin")
});
insta::assert_snapshot!(output, @r#"
------- stderr -------
Working copy (@) now at: qpvuntsm 67a86922 (empty) first stdin
Parent commit (@-) : zzzzzzzz 00000000 (empty) (no description set)
[EOF]
"#);
let output = work_dir.run_jj(["log", "--no-graph", "-r@", "-Tdescription"]);
insta::assert_snapshot!(output, @r"
first stdin
second stdin[EOF]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a bug. A description set by CLI should be terminated by newline.

");
}

#[test]
fn test_describe_default_description() {
let mut test_env = TestEnvironment::default();
Expand Down