Skip to content

Commit

Permalink
✅ Add test for list with --format jsonl option
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune committed Nov 24, 2024
1 parent 6e0fe34 commit a0cb5ef
Showing 1 changed file with 78 additions and 7 deletions.
85 changes: 78 additions & 7 deletions cli/tests/cli/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ fn archive_list_detail() {
"--aes",
"ctr",
#[cfg(windows)]
{
"--unstable"
},
"--unstable",
]))
.unwrap();
command::entry(cli::Cli::parse_from([
Expand Down Expand Up @@ -97,10 +95,7 @@ fn archive_list_solid_detail() {
"password",
"--aes",
"ctr",
#[cfg(windows)]
{
"--unstable"
},
"--unstable",
]))
.unwrap();
command::entry(cli::Cli::parse_from([
Expand All @@ -114,3 +109,79 @@ fn archive_list_solid_detail() {
]))
.unwrap();
}

#[test]
fn archive_list_jsonl() {
command::entry(cli::Cli::parse_from([
"pna",
"--quiet",
"c",
&format!("{}/list_jsonl.pna", env!("CARGO_TARGET_TMPDIR")),
"--overwrite",
"-r",
"../resources/test/raw",
#[cfg(not(target_os = "netbsd"))]
"--keep-xattr",
"--keep-timestamp",
"--keep-permission",
#[cfg(feature = "acl")]
"--keep-acl",
"--password",
"password",
"--aes",
"ctr",
"--unstable",
]))
.unwrap();
command::entry(cli::Cli::parse_from([
"pna",
"list",
"-l",
"--format",
"jsonl",
&format!("{}/list_jsonl.pna", env!("CARGO_TARGET_TMPDIR")),
"--password",
"password",
"--unstable",
]))
.unwrap();
}

#[test]
fn archive_list_solid_jsonl() {
command::entry(cli::Cli::parse_from([
"pna",
"--quiet",
"c",
&format!("{}/list_solid_jsonl.pna", env!("CARGO_TARGET_TMPDIR")),
"--overwrite",
"-r",
"../resources/test/raw",
"--solid",
#[cfg(not(target_os = "netbsd"))]
"--keep-xattr",
"--keep-timestamp",
"--keep-permission",
#[cfg(feature = "acl")]
"--keep-acl",
"--password",
"password",
"--aes",
"ctr",
"--unstable",
]))
.unwrap();
command::entry(cli::Cli::parse_from([
"pna",
"list",
"-l",
"--format",
"jsonl",
&format!("{}/list_solid_jsonl.pna", env!("CARGO_TARGET_TMPDIR")),
"--solid",
"--password",
"password",
"--unstable",
]))
.unwrap();
}

0 comments on commit a0cb5ef

Please sign in to comment.