MCPcopy Create free account
hub / github.com/daniel-e/rustml / test_group

Function test_group

src/vectors.rs:379–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

377
378 #[test]
379 fn test_group() {
380
381 let mut v = vec![1.0, 1.0, 2.0, 7.0, 7.0, 9.0, 9.0, 9.0];
382 let mut r = group(&v);
383 assert_eq!(r, vec![(1.0, 2), (2.0, 1), (7.0, 2), (9.0, 3)]);
384
385 v = vec![];
386 r = group(&v);
387 assert_eq!(r, vec![]);
388
389 v = vec![1.0, 2.0, 2.0, 2.0, 3.0, 4.0];
390 r = group(&v);
391 assert_eq!(r, vec![(1.0, 1), (2.0, 3), (3.0, 1), (4.0, 1)]);
392 }
393
394 #[test]
395 fn test_copy_memory() {

Callers

nothing calls this directly

Calls 1

groupFunction · 0.85

Tested by

no test coverage detected