ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
23 lines (21 loc) • 864 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const textSeek_1 = require("./../../../manipulation/textSeek");
describe("getNextNonWhitespacePos", () => {
function doTest(fileText, pos, expectedPos) {
chai_1.expect(textSeek_1.getNextNonWhitespacePos(fileText, pos)).to.equal(expectedPos);
}
it("should the next non whitespace char", () => {
let code = " \r\n\t \t ";
const expectedPos = code.length;
code += "a \t aaa";
doTest(code, 5, expectedPos);
});
it("should return the end of the string if only whitespace are found", () => {
const code = "\r\n \r \t \t \n ";
const expectedPos = code.length;
doTest(code, 0, expectedPos);
});
});
//# sourceMappingURL=getNextNonWhitespacePosTests.js.map