mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Added a count column on the histogram command (#1853)
* Adding iniitial draft for the addition of the count column on the histogram command * Update histogram documentation * Add count column test to histogram command * Fix error in histogram documentation
This commit is contained in:
@ -62,3 +62,22 @@ fn help() {
|
||||
assert_eq!(help_long.out, help_command.out);
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn count() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo "[{"bit":1},{"bit":0},{"bit":0},{"bit":0},{"bit":0},{"bit":0},{"bit":0},{"bit":1}]"
|
||||
| from json
|
||||
| histogram bit
|
||||
| sort-by count
|
||||
| reject frequency
|
||||
| to json
|
||||
"#
|
||||
));
|
||||
|
||||
let bit_json = r#"[{"bit":"1","count":2},{"bit":"0","count":6}]"#;
|
||||
|
||||
assert_eq!(actual.out, bit_json);
|
||||
}
|
||||
|
Reference in New Issue
Block a user