Skip to content
Myr

Remove the TestExporter

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent 6fe7738 · Browse files · 1 file+5 added−20 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−20 removed

  • other:+5 added−20 removed

1 file+5 added−20 removed

modified:src/export/mod.rs+5 added-20 removed
116 unmodified lines
117 file.write_all(content)118 .with_context(|| format!("Failed to export results to '{}'", filename))119}120121#[cfg(test)]122#[derive(Default)]123struct TestExporter;124125#[cfg(test)]126impl Exporter for TestExporter {127 fn serialize(&self, _results: &[BenchmarkResult], _unit: Option<Unit>) -> Result<Vec<u8>> {128 assert_eq!(129 "",130 "This 'Exporter' trait implementation shall only be used to test the 'unit' function!"131 );132 Ok(vec![])133 }134}135121/// Check unit resolving for timing results and given unit 's'122#[test]138fn test_markup_table_unit_given_s() {123fn test_determine_unit_from_results_unit_given_s() {124 use std::collections::BTreeMap;125 let results = vec![126 BenchmarkResult {127 command: String::from("sleep 2"),
31 unmodified lines
159}160161/// Check unit resolving for timing results and given unit 'ms'162#[test]178fn test_markup_table_unit_given_ms() {163fn test_determine_unit_from_results_unit_given_ms() {164 use std::collections::BTreeMap;165 let results = vec![166 BenchmarkResult {167 command: String::from("sleep 2"),
31 unmodified lines
199}200201/// Check unit resolving for timing results using the first result entry as 's'202#[test]218fn test_markup_table_unit_first_s() {203fn test_determine_unit_from_results_unit_first_s() {204 use std::collections::BTreeMap;205 let results = vec![206 BenchmarkResult {207 command: String::from("sleep 2"),
31 unmodified lines
239}240241/// Check unit resolving for timing results using the first result entry as 'ms'242#[test]258fn test_markup_table_unit_first_ms() {243fn test_determine_unit_from_results_unit_first_ms() {244 use std::collections::BTreeMap;245 let results = vec![246 BenchmarkResult {247 command: String::from("sleep 0.1"),
31 unmodified lines
279}280281/// Check unit resolving for not timing results and no given unit defaulting to 's'282#[test]298fn test_markup_table_unit_default_s() {283fn test_determine_unit_from_results_unit_default_s() {284 let results: Vec<BenchmarkResult> = vec![];285 let unit = None;286287 let markup_actual = unit.unwrap_or_else(|| determine_unit_from_results(&results));
4 unmodified lines