Restore ledger-tool print and json commands (#5048) (#5049)

automerge
This commit is contained in:
mergify[bot]
2019-07-11 21:14:37 -07:00
committed by Grimes
parent d08a810c08
commit 086e20f6c7
3 changed files with 75 additions and 206 deletions

View File

@@ -45,20 +45,5 @@ fn nominal() {
// Print everything
let output = run_ledger_tool(&["-l", &ledger_path, "print"]);
assert!(output.status.success());
assert_eq!(count_newlines(&output.stdout), ticks);
// Only print the first 5 items
let output = run_ledger_tool(&["-l", &ledger_path, "-n", "5", "print"]);
assert!(output.status.success());
assert_eq!(count_newlines(&output.stdout), 5);
// Skip entries with no hashes
let output = run_ledger_tool(&["-l", &ledger_path, "-h", "1", "print"]);
assert!(output.status.success());
assert_eq!(count_newlines(&output.stdout), ticks);
// Skip entries with fewer than 2 hashes (skip everything)
let output = run_ledger_tool(&["-l", &ledger_path, "-h", "2", "print"]);
assert!(output.status.success());
assert_eq!(count_newlines(&output.stdout), 0);
assert_eq!(count_newlines(&output.stdout), ticks + 1);
}