"use strict";
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var chai_1 = require("chai");
var installable_1 = require("../../common/protocol/installable");
describe('installable', function () {
    describe('compare', function () {
        var testMe = installable_1.Installable.Version.COMPARATOR;
        [
            ['1.8.1', '1.8.1', 0],
            ['1.8.1', '1.6.1', 1],
            ['1.6.1', '1.8.1', -1],
            ['1.6.1', '1.6.3', -1],
            ['5.1.1', '5.1.0', 1],
            ['5.1.0', '5.1.0-beta.1', 1],
            ['5.1.0-beta.1', '5.1.0', -1],
            ['5.1.0-beta.2', '5.1.0-beta.1', 1],
            ['5.1.0-beta.1', '5.1.0-beta.2', -1],
            ['5.1.0-beta.1', '5.1.1', -1],
            ['1.1.0', '1.1.0-a', 1],
            ['1.1.0-a', '1.1.0', -1],
            ['COM1', 'COM2', -1],
            ['COM1', 'COM10', -1],
            ['COM10', 'COM1', 1],
            ['COM10', 'COM2', 1],
            ['COM2', 'COM10', -1],
            ['COM10', 'COM10', 0],
        ].forEach(function (_a) {
            var _b = __read(_a, 3), left = _b[0], right = _b[1], expectation = _b[2];
            it("'" + left + "' should be " + (expectation === 0 ? 'equal to' : expectation < 0 ? 'less than' : 'greater than') + " '" + right + "'", function () {
                var actual = testMe(left, right);
                chai_1.expect(actual).to.be.equal(expectation);
            });
        });
    });
});
//# sourceMappingURL=installable.test.js.map