define([
    'bitbucket/internal/util/abbreviate-commit-message'
], function(
    abbreviateCommitMessage
    ) {

    'use strict';

    module('util-abbreviate-commit-message');

    test("valid inputs", function () {
        // same test cases as the Java implementation in AbbreviatedCommitMessageFunctionTest
        strictEqual(abbreviateCommitMessage("commit message\nwith a new line", 20), "commit message...");
        strictEqual(abbreviateCommitMessage("commit message\nwith a new line", 17), "commit message...");
        strictEqual(abbreviateCommitMessage("commit message\nwith a new line", 10), "commit ...");
        strictEqual(abbreviateCommitMessage("commit message\nwith a new line", 30), "commit message\nwith a new line");
        strictEqual(abbreviateCommitMessage("commit message without a new line", 29), "commit message without a n...");
        strictEqual(abbreviateCommitMessage("commit message without a new line", 33), "commit message without a new line");
        strictEqual(abbreviateCommitMessage("commit message without a new line", 10), "commit ...");
    });
});
