@@ -36,19 +36,25 @@ public void testOnlyOfValidator() throws Exception {
3636 assertTrue (Bytes .wrap (new byte []{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 }).validateNotOnlyZeros ());
3737 assertTrue (Bytes .random (128 ).validateNotOnlyZeros ());
3838
39- assertTrue (Bytes .allocate (0 ).validate (BytesValidators .onlyOf ((byte ) 0 )));
39+ assertTrue (Bytes .allocate (1 ).validate (BytesValidators .onlyOf ((byte ) 0 )));
40+ assertFalse (Bytes .allocate (1 ).validate (BytesValidators .noneOf ((byte ) 0 )));
41+ assertFalse (Bytes .allocate (1 ).validate (BytesValidators .onlyOf ((byte ) 1 )));
42+ assertTrue (Bytes .allocate (1 ).validate (BytesValidators .noneOf ((byte ) 1 )));
43+ assertTrue (Bytes .allocate (1 ).validate (BytesValidators .noneOf ((byte ) 1 )));
44+ assertTrue (Bytes .wrap (new byte []{1 , 1 , 1 , 1 , 0 , 1 }).validate (BytesValidators .notOnlyOf ((byte ) 1 )));
45+ assertFalse (Bytes .wrap (new byte []{1 , 1 , 1 , 1 , 1 }).validate (BytesValidators .notOnlyOf ((byte ) 1 )));
4046 assertTrue (Bytes .wrap (new byte []{1 , 1 , 1 , 1 , 1 , 1 }).validate (BytesValidators .onlyOf ((byte ) 1 )));
4147 }
4248
4349 @ Test
4450 public void testLengthValidators () throws Exception {
45- assertFalse (Bytes .allocate (0 ).validate (BytesValidators .longerThan (1 )));
46- assertFalse (Bytes .allocate (1 ).validate (BytesValidators .longerThan (1 )));
47- assertTrue (Bytes .allocate (2 ).validate (BytesValidators .longerThan (1 )));
51+ assertFalse (Bytes .allocate (0 ).validate (BytesValidators .atLeast (1 )));
52+ assertTrue (Bytes .allocate (1 ).validate (BytesValidators .atLeast (1 )));
53+ assertTrue (Bytes .allocate (2 ).validate (BytesValidators .atLeast (1 )));
4854
49- assertFalse (Bytes .allocate (2 ).validate (BytesValidators .shorterThan (1 )));
50- assertFalse (Bytes .allocate (1 ).validate (BytesValidators .shorterThan (1 )));
51- assertTrue (Bytes .allocate (0 ).validate (BytesValidators .shorterThan (1 )));
55+ assertFalse (Bytes .allocate (2 ).validate (BytesValidators .atMost (1 )));
56+ assertTrue (Bytes .allocate (1 ).validate (BytesValidators .atMost (1 )));
57+ assertTrue (Bytes .allocate (0 ).validate (BytesValidators .atMost (1 )));
5258
5359 assertFalse (Bytes .allocate (0 ).validate (BytesValidators .exactLength (1 )));
5460 assertTrue (Bytes .allocate (1 ).validate (BytesValidators .exactLength (1 )));
0 commit comments