"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var assert = require("assert");
var oniguruma_1 = require("../src/oniguruma");
describe('OnigString', function () {
    it('has a length property', function () {
        assert.equal(new oniguruma_1.OnigString('abc').length, 3);
    });
    it('can be converted back into a string', function () {
        assert.equal(new oniguruma_1.OnigString('abc').toString(), 'abc');
    });
    it('can retrieve substrings (for conveniently inspecting captured text)', function () {
        var s = 'abcdef';
        var onigString = new oniguruma_1.OnigString(s);
        assert.equal(onigString.substring(2, 3), s.substring(2, 3));
        assert.equal(onigString.substring(2), s.substring(2));
        assert.equal(onigString.substring(), s.substring());
        assert.equal(onigString.substring(-1), s.substring(-1));
        assert.equal(onigString.substring(-1, -2), s.substring(-1, -2));
        onigString.substring({});
        onigString.substring(null, undefined);
    });
    it('handles invalid arguments', function () {
        assert.throws(function () { return oniguruma_1.OnigString(undefined).toString(); }, /Type mismatch/);
    });
});
//# sourceMappingURL=string_test.js.map