(t *testing.T)
| 970 | } |
| 971 | |
| 972 | func TestMatrixTranslatePoint(t *testing.T) { |
| 973 | data := []struct { |
| 974 | matrix, expected []float32 |
| 975 | point Point |
| 976 | }{ |
| 977 | { |
| 978 | point: Point{ |
| 979 | X: 0, |
| 980 | Y: 0, |
| 981 | }, |
| 982 | matrix: []float32{ |
| 983 | 0, 1, 2, |
| 984 | 1, 2, 3, |
| 985 | 2, 3, 4, |
| 986 | }, |
| 987 | expected: []float32{ |
| 988 | 0, 1, 2, |
| 989 | 1, 2, 3, |
| 990 | 2, 3, 4, |
| 991 | }, |
| 992 | }, |
| 993 | { |
| 994 | point: Point{ |
| 995 | X: 15, |
| 996 | Y: 15, |
| 997 | }, |
| 998 | matrix: []float32{ |
| 999 | 0, 1, 2, |
| 1000 | 1, 2, 3, |
| 1001 | 2, 3, 4, |
| 1002 | }, |
| 1003 | expected: []float32{ |
| 1004 | 0, 1, 2, |
| 1005 | 1, 2, 3, |
| 1006 | 17, 48, 79, |
| 1007 | }, |
| 1008 | }, |
| 1009 | { |
| 1010 | point: Point{ |
| 1011 | X: -5, |
| 1012 | Y: -5, |
| 1013 | }, |
| 1014 | matrix: []float32{ |
| 1015 | 0, 1, 2, |
| 1016 | 1, 2, 3, |
| 1017 | 2, 3, 4, |
| 1018 | }, |
| 1019 | expected: []float32{ |
| 1020 | 0, 1, 2, |
| 1021 | 1, 2, 3, |
| 1022 | -3, -12, -21, |
| 1023 | }, |
| 1024 | }, |
| 1025 | { |
| 1026 | point: Point{ |
| 1027 | X: 5, |
| 1028 | Y: -5, |
| 1029 | }, |
nothing calls this directly
no test coverage detected