mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Add new --sort option
This adds a new `--sort` option to choose the way in which the results in the speed comparison and the markup exports are ordered. closes #614 closes #601
This commit is contained in:
1 parent
2393de0c36
commit
ac617c8714
12 files changed
+285
-89
No files matched your search
+15
-3
@@ -22,6 +22,9 @@ impl MarkupExporter for OrgmodeExporter {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::options::SortOrder;
|
||||
|
||||
/// Check Emacs org-mode data row formatting
|
||||
#[test]
|
||||
fn test_orgmode_formatter_table_data() {
|
||||
@@ -105,7 +108,12 @@ fn test_orgmode_format_ms() {
|
||||
},
|
||||
];
|
||||
|
||||
let actual = String::from_utf8(exporter.serialize(&results, None).unwrap()).unwrap();
|
||||
let actual = String::from_utf8(
|
||||
exporter
|
||||
.serialize(&results, None, SortOrder::Command)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
let expect = format!(
|
||||
"{}\
|
||||
| =sleep 0.1= | 105.7 ± 1.6 | 102.3 | 108.0 | 1.00 |
|
||||
@@ -159,8 +167,12 @@ fn test_orgmode_format_s() {
|
||||
},
|
||||
];
|
||||
|
||||
let actual =
|
||||
String::from_utf8(exporter.serialize(&results, Some(Unit::Second)).unwrap()).unwrap();
|
||||
let actual = String::from_utf8(
|
||||
exporter
|
||||
.serialize(&results, Some(Unit::Second), SortOrder::Command)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
let expect = format!(
|
||||
"{}\
|
||||
| =sleep 2= | 2.005 ± 0.002 | 2.002 | 2.008 | 18.97 ± 0.29 |
|
||||
|
||||
Reference in new issue
Block a user