use liveplot::data::scope::{AxisSettings, AxisType, ScopeData, ScopeType, XDateFormat};
use liveplot::data::x_formatter::XFormatter;
#[test]
fn scope_auto_x_formatter_switches_for_time_and_xy() {
let mut scope = ScopeData::default();
assert_eq!(scope.scope_type, ScopeType::TimeScope);
let t = 1_700_000_000.0_f64; let out = scope.x_axis.format_value(t, 4, 1.0);
assert!(out.contains(":") || out.contains("-"));
scope.scope_type = ScopeType::XYScope;
scope.x_axis.axis_type = AxisType::Value(None);
scope.x_axis.name = Some("X".to_string());
scope.x_axis.x_formatter = XFormatter::Auto;
let v = 1234.5678_f64;
let out2 = scope.x_axis.format_value(v, 2, 1.0);
assert!(!out2.contains(":") && !out2.contains("-"));
}