File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
tests/BenchmarkDotNet.IntegrationTests Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -692,6 +692,33 @@ public void AcceptsMultidimensionalArray(int[,] arr)
692692 }
693693 }
694694
695+ [ Theory , MemberData ( nameof ( GetToolchains ) , DisableDiscoveryEnumeration = true ) ]
696+ public void MultidimensionalAndJaggedArraysCanBeMixed ( IToolchain toolchain )
697+ {
698+ var summary = CanExecute < WithMixedJaggedAndMultidimensionalArrays > ( toolchain ) ;
699+
700+ Assert . Equal (
701+ "Int32[0, 0][][,][]" ,
702+ summary . Table . Columns . Where ( col => col . Header == "arr" ) . First ( ) . Content [ 0 ]
703+ ) ;
704+ }
705+
706+ public class WithMixedJaggedAndMultidimensionalArrays
707+ {
708+ public IEnumerable < int [ , ] [ ] [ , ] [ ] > GetArrays ( )
709+ {
710+ yield return new int [ , ] [ ] [ , ] [ ] { } ;
711+ }
712+
713+ [ Benchmark ]
714+ [ ArgumentsSource ( nameof ( GetArrays ) ) ]
715+ public void NaiveMatrixMultiply ( int [ , ] [ ] [ , ] [ ] arr )
716+ {
717+ if ( arr . Length > 0 )
718+ throw new ArgumentException ( "Incorrect length" ) ;
719+ }
720+ }
721+
695722 [ Theory , MemberData ( nameof ( GetToolchains ) , DisableDiscoveryEnumeration = true ) ]
696723 public void VeryBigIntegersAreSupported ( IToolchain toolchain ) => CanExecute < WithVeryBigInteger > ( toolchain ) ;
697724
You can’t perform that action at this time.
0 commit comments