Skip to content

Commit

Permalink
Removed expectRangeToBe helper
Browse files Browse the repository at this point in the history
  • Loading branch information
markwpearce committed Jun 11, 2024
1 parent 62eb1eb commit 0c768a1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { BsConfig } from './BsConfig';
import * as fsExtra from 'fs-extra';
import { createSandbox } from 'sinon';
import { DiagnosticMessages } from './DiagnosticMessages';
import { tempDir, rootDir, expectTypeToBe, expectRangeToBe } from './testHelpers.spec';
import { tempDir, rootDir, expectTypeToBe } from './testHelpers.spec';
import { Program } from './Program';
import type { BsDiagnostic } from './interfaces';
import { TypeChainEntry } from './interfaces';
Expand Down Expand Up @@ -656,9 +656,9 @@ describe('util', () => {
const pos11 = { line: 1, character: 1 };
const pos99 = { line: 9, character: 9 };

expectRangeToBe(util.createRangeFromPositions(pos11, pos99), util.createRange(1, 1, 9, 9));
expectRangeToBe(util.createRangeFromPositions(null, pos99), util.createRange(9, 9, 9, 9));
expectRangeToBe(util.createRangeFromPositions(pos11, null), util.createRange(1, 1, 1, 1));
expect(util.createRangeFromPositions(pos11, pos99)).to.eql(util.createRange(1, 1, 9, 9));
expect(util.createRangeFromPositions(null, pos99)).to.eql(util.createRange(9, 9, 9, 9));
expect(util.createRangeFromPositions(pos11, null)).to.eql(util.createRange(1, 1, 1, 1));
});


Expand All @@ -667,10 +667,10 @@ describe('util', () => {
const range2 = util.createRange(2, 2, 3, 3);
const range3 = util.createRange(100, 100, 100, 100);

expectRangeToBe(util.createBoundingRange(range1), util.createRange(1, 1, 2, 2));
expectRangeToBe(util.createBoundingRange(range1, range2), util.createRange(1, 1, 3, 3));
expectRangeToBe(util.createBoundingRange(range2, range1), util.createRange(1, 1, 3, 3));
expectRangeToBe(util.createBoundingRange(range2, range3, range1), util.createRange(1, 1, 100, 100));
expect(util.createBoundingRange(range1)).to.eql(util.createRange(1, 1, 2, 2));
expect(util.createBoundingRange(range1, range2)).to.eql(util.createRange(1, 1, 3, 3));
expect(util.createBoundingRange(range2, range1)).to.eql(util.createRange(1, 1, 3, 3));
expect(util.createBoundingRange(range2, range3, range1)).to.eql(util.createRange(1, 1, 100, 100));
});
});

Expand Down

0 comments on commit 0c768a1

Please sign in to comment.