()
| 113 | } |
| 114 | |
| 115 | func (s *ProcessingTestSuite) TestResizeToFit() { |
| 116 | testCases := []testCase[sizeTestCase]{ |
| 117 | {opts: sizeTestCase{width: 50, height: 50}, outSize: testSize{50, 25}}, |
| 118 | {opts: sizeTestCase{width: 50, height: 20}, outSize: testSize{40, 20}}, |
| 119 | {opts: sizeTestCase{width: 20, height: 50}, outSize: testSize{20, 10}}, |
| 120 | {opts: sizeTestCase{width: 300, height: 300}, outSize: testSize{200, 100}}, |
| 121 | {opts: sizeTestCase{width: 300, height: 50}, outSize: testSize{100, 50}}, |
| 122 | {opts: sizeTestCase{width: 100, height: 300}, outSize: testSize{100, 50}}, |
| 123 | {opts: sizeTestCase{width: 0, height: 50}, outSize: testSize{100, 50}}, |
| 124 | {opts: sizeTestCase{width: 50, height: 0}, outSize: testSize{50, 25}}, |
| 125 | {opts: sizeTestCase{width: 0, height: 200}, outSize: testSize{200, 100}}, |
| 126 | {opts: sizeTestCase{width: 300, height: 0}, outSize: testSize{200, 100}}, |
| 127 | } |
| 128 | |
| 129 | for _, tc := range testCases { |
| 130 | s.Run(tc.opts.ShortName(), func() { |
| 131 | tc.opts.resizingType = processing.ResizeFit |
| 132 | |
| 133 | s.processImageAndCheck(tc) |
| 134 | }) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | func (s *ProcessingTestSuite) TestResizeToFitEnlarge() { |
| 139 | testCases := []testCase[sizeTestCase]{ |
nothing calls this directly
no test coverage detected