예제 #1
0
 def test_one_element_matrix(self):
     self.assertEqual(zeroMatrix([[1]]), [[1]])
예제 #2
0
 def test_no_zeroes(self):
     self.assertEqual(zeroMatrix([[1, 2], [3, 4]]), [[1, 2], [3, 4]])
예제 #3
0
 def test_empty_matrix(self):
     self.assertEqual(zeroMatrix([[]]), [[]])
예제 #4
0
 def test_all_zeroes(self):
     self.assertEqual(zeroMatrix([[0, 0], [0, 0]]), [[0, 0], [0, 0]])
예제 #5
0
 def test_three_by_three(self):
     self.assertEqual(zeroMatrix([[2, 1, 2], [0, 4, 0], [6, 7, 0]]),
                      [[0, 1, 0], [0, 0, 0], [0, 0, 0]])
예제 #6
0
 def test_two_by_three_two_zeroes(self):
     self.assertEqual(zeroMatrix([[0, 0, 3], [2, 1, 4]]),
                      [[0, 0, 0], [0, 0, 4]])
예제 #7
0
 def test_two_by_three_one_zero(self):
     self.assertEqual(zeroMatrix([
         [1, 0, 2],
         [3, 4, 5],
     ]), [[0, 0, 0], [3, 0, 5]])
예제 #8
0
 def test_two_by_two_matrix(self):
     self.assertEqual(zeroMatrix([[1, 2], [3, 0]]), [[1, 0], [0, 0]])