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:
David Peter authored and David Peter committed 2023-06-03 21:34:36 +02:00
1 parent 2393de0c36
commit ac617c8714
12 files changed
+285 -89

No files matched your search

+15 -3
View File
@@ -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 |