File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ thiserror = "1.0"
2323
2424[dev-dependencies ]
2525lazy_static = " 1.4.0"
26+ proptest = " 1.0"
2627serial_test = " 0.5.1"
2728solana-program-test = " 1.10.33"
2829solana-sdk = " 1.10.33"
Original file line number Diff line number Diff line change @@ -1431,7 +1431,7 @@ pub fn is_valid_signer_index(index: usize) -> bool {
14311431
14321432#[ cfg( test) ]
14331433mod test {
1434- use super :: * ;
1434+ use { super :: * , proptest :: prelude :: * } ;
14351435
14361436 #[ test]
14371437 fn test_instruction_packing ( ) {
@@ -1674,14 +1674,13 @@ mod test {
16741674 assert_eq ! ( unpacked, check) ;
16751675 }
16761676
1677- #[ test]
1678- fn test_instruction_unpack_panic ( ) {
1679- for i in 0 ..255u8 {
1680- for j in 1 ..10 {
1681- let mut data = vec ! [ 0 ; j] ;
1682- data[ 0 ] = i;
1683- let _no_panic = TokenInstruction :: unpack ( & data) ;
1684- }
1677+ proptest ! {
1678+ #![ proptest_config( ProptestConfig :: with_cases( 1024 ) ) ]
1679+ #[ test]
1680+ fn test_instruction_unpack_panic(
1681+ data in prop:: collection:: vec( any:: <u8 >( ) , 0 ..255 )
1682+ ) {
1683+ let _no_panic = TokenInstruction :: unpack( & data) ;
16851684 }
16861685 }
16871686}
You can’t perform that action at this time.
0 commit comments