import {Image} from 'test/common';
import 'should';

describe('Monotone Chain Convex Hull', function () {
    it('should return the convex hull', function () {
        let image = new Image(8, 8,
            [
                0b00000000,
                0b00011000,
                0b00011000,
                0b00111111,
                0b00111111,
                0b00011000,
                0b00011000,
                0b00000000
            ],
            {kind: 'BINARY'}
        );

        image.monotoneChainConvexHull().should.eql([
            [2, 3],
            [2, 4],
            [3, 6],
            [4, 6],
            [7, 4],
            [7, 3],
            [4, 1],
            [3, 1]
        ]);
    });
});

@@ -714,12 +714,594 @@
     %7D);%0A
+%0A    it('should return the convex hull for one point', function () %7B%0A        let image = new Image(1, 1,%0A            %5B%0A                0b10000000%0A            %5D,%0A            %7Bkind: 'BINARY'%7D%0A        );%0A%0A        image.monotoneChainConvexHull().should.eql(%5B%5D);%0A    %7D);%0A%0A    it('should return the convex hull for two points', function () %7B%0A        let image = new Image(1, 2,%0A            %5B%0A                0b11000000%0A            %5D,%0A            %7Bkind: 'BINARY'%7D%0A        );%0A%0A        image.monotoneChainConvexHull().should.eql(%5B%0A            %5B0, 0%5D,%0A            %5B0, 1%5D%0A        %5D);%0A    %7D);%0A%0A
 %7D);%0A

Add test cases for 1 pixel and 2 pixels in convex hull