From a0cb5efae4631243c414438b0277f4ddb51c6511 Mon Sep 17 00:00:00 2001 From: ChanTsune <41658782+ChanTsune@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:30:58 +0900 Subject: [PATCH] :white_check_mark: Add test for list with --format jsonl option --- cli/tests/cli/list.rs | 85 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 7 deletions(-) diff --git a/cli/tests/cli/list.rs b/cli/tests/cli/list.rs index 40854e5d..f40ee701 100644 --- a/cli/tests/cli/list.rs +++ b/cli/tests/cli/list.rs @@ -62,9 +62,7 @@ fn archive_list_detail() { "--aes", "ctr", #[cfg(windows)] - { - "--unstable" - }, + "--unstable", ])) .unwrap(); command::entry(cli::Cli::parse_from([ @@ -97,10 +95,7 @@ fn archive_list_solid_detail() { "password", "--aes", "ctr", - #[cfg(windows)] - { - "--unstable" - }, + "--unstable", ])) .unwrap(); command::entry(cli::Cli::parse_from([ @@ -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(); +}