Added unit test for matrix set function