MCPcopy Create free account
hub / github.com/cpmech/plotpy / vector_to_array_works

Function vector_to_array_works

src/conversions.rs:138–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137 #[test]
138 fn vector_to_array_works() {
139 let mut buf = String::new();
140 let x: Vec<f64> = vec![0.1, 0.2, 0.3];
141 let y: [f64; 3] = [1.0, 2.0, 3.0];
142 let z: &[f64] = &[10.0, 20.0, 30.0];
143 vector_to_array(&mut buf, "x", &x);
144 vector_to_array(&mut buf, "y", &y);
145 vector_to_array(&mut buf, "z", &z);
146 assert_eq!(
147 buf,
148 "x=np.array([0.1,0.2,0.3,])\n\
149 y=np.array([1,2,3,])\n\
150 z=np.array([10,20,30,])\n"
151 );
152 }
153
154 #[test]
155 fn generate_nested_list_works() {

Callers

nothing calls this directly

Calls 1

vector_to_arrayFunction · 0.85

Tested by

no test coverage detected