We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
iproduct
1 parent b32a3b3 commit b1be1e4Copy full SHA for b1be1e4
tests/macros_hygiene.rs
@@ -1,5 +1,6 @@
1
#[test]
2
fn iproduct_hygiene() {
3
+ let _ = itertools::iproduct!();
4
let _ = itertools::iproduct!(0..6);
5
let _ = itertools::iproduct!(0..6, 0..9);
6
let _ = itertools::iproduct!(0..6, 0..9, 0..12);
tests/test_core.rs
@@ -18,6 +18,23 @@ use crate::it::Itertools;
18
use core::iter;
19
use itertools as it;
20
21
+#[test]
22
+fn product0() {
23
+ let mut prod = iproduct!();
24
+ assert_eq!(prod.next(), Some(()));
25
+ assert!(prod.next().is_none());
26
+}
27
+
28
29
+fn iproduct1() {
30
+ let s = "αβ";
31
32
+ let mut prod = iproduct!(s.chars());
33
+ assert_eq!(prod.next(), Some(('α',)));
34
+ assert_eq!(prod.next(), Some(('β',)));
35
36
37
38
39
fn product2() {
40
let s = "αβ";
0 commit comments