tests: add foreach testing for matrix