add to_values

This commit is contained in:
Simon Gardling
2022-05-18 14:31:51 -04:00
parent 001a21f250
commit c753621cf8
2 changed files with 23 additions and 3 deletions

View File

@@ -115,6 +115,17 @@ fn invalid_hashed_storage() {
assert_eq!(hashed_storage_read("aaaa"), None);
}
#[test]
fn to_values() {
use egui::plot::{Value, Values};
use ytbn_graphing_software::EguiHelper;
let data_raw = vec![(0.0, 1.0), (1.0, 3.0), (2.0, 4.0)];
let data: Vec<Value> = data_raw.iter().map(|(x, y)| Value::new(*x, *y)).collect();
let values: Values = data.clone().to_values();
assert_eq!(*values.get_values(), data);
}
#[test]
fn to_tuple() {
use egui::plot::Value;