File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
#[ test]
2
2
fn iproduct_hygiene ( ) {
3
+ let _ = itertools:: iproduct!( ) ;
3
4
let _ = itertools:: iproduct!( 0 ..6 ) ;
4
5
let _ = itertools:: iproduct!( 0 ..6 , 0 ..9 ) ;
5
6
let _ = itertools:: iproduct!( 0 ..6 , 0 ..9 , 0 ..12 ) ;
Original file line number Diff line number Diff line change @@ -18,6 +18,23 @@ use crate::it::Itertools;
18
18
use core:: iter;
19
19
use itertools as it;
20
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
+ #[ test]
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
+ assert ! ( prod. next( ) . is_none( ) ) ;
36
+ }
37
+
21
38
#[ test]
22
39
fn product2 ( ) {
23
40
let s = "αβ" ;
You can’t perform that action at this time.
0 commit comments