Skip to content

Commit

Permalink
stops using "contradictions" terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisC committed Dec 7, 2023
1 parent 09eb95a commit f27f002
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
28 changes: 13 additions & 15 deletions scripts/update-bcd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
findEntry,
getSupportMap,
getSupportMatrix,
hasSupportMatrixContradictions,
hasSupportUpdates,
inferSupportStatements,
splitRange,
update,
Expand Down Expand Up @@ -825,25 +825,23 @@ describe("BCD updater", () => {
describe("hasSupportMatrixContradictions", () => {
it("detects contradictions with nonexistent support statements", () => {
assert.isTrue(
hasSupportMatrixContradictions(new Map([["80", true]]), {
hasSupportUpdates(new Map([["80", true]]), {
version_added: null,
}),
);

assert.isTrue(
hasSupportMatrixContradictions(new Map([["80", true]]), undefined),
);
assert.isTrue(hasSupportUpdates(new Map([["80", true]]), undefined));
});

it("skips null support claims", () => {
assert.isFalse(
hasSupportMatrixContradictions(new Map([["80", null]]), {
hasSupportUpdates(new Map([["80", null]]), {
version_added: "≤80",
}),
);

assert.isFalse(
hasSupportMatrixContradictions(
hasSupportUpdates(
new Map([
["79", false],
["80", true],
Expand All @@ -860,21 +858,21 @@ describe("BCD updater", () => {

it("detects contradictions in statements with boolean values", () => {
assert.isFalse(
hasSupportMatrixContradictions(new Map([["80", false]]), {
hasSupportUpdates(new Map([["80", false]]), {
version_added: false,
}),
"skips generic false statements",
);

assert.isTrue(
hasSupportMatrixContradictions(new Map([["80", true]]), {
hasSupportUpdates(new Map([["80", true]]), {
version_added: true,
}),
"catches specific support updates over generic true statements",
);

assert.isTrue(
hasSupportMatrixContradictions(
hasSupportUpdates(
new Map([
["80", false],
["81", true],
Expand All @@ -886,7 +884,7 @@ describe("BCD updater", () => {

it("detects contradictions in statements with string values", () => {
assert.isTrue(
hasSupportMatrixContradictions(
hasSupportUpdates(
new Map([
["79", false],
["80", false],
Expand All @@ -899,7 +897,7 @@ describe("BCD updater", () => {
);

assert.isFalse(
hasSupportMatrixContradictions(
hasSupportUpdates(
new Map([
["79", false],
["80", false],
Expand All @@ -912,7 +910,7 @@ describe("BCD updater", () => {
);

assert.isFalse(
hasSupportMatrixContradictions(
hasSupportUpdates(
new Map([
["79", false],
["80", true],
Expand All @@ -925,7 +923,7 @@ describe("BCD updater", () => {
);

assert.isTrue(
hasSupportMatrixContradictions(
hasSupportUpdates(
new Map([
["79", false],
["80", true],
Expand All @@ -940,7 +938,7 @@ describe("BCD updater", () => {
);

assert.isTrue(
hasSupportMatrixContradictions(
hasSupportUpdates(
new Map([
["79", false],
["80", true],
Expand Down
6 changes: 3 additions & 3 deletions scripts/update-bcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ const skipCurrentBeforeSupport = skip("currentBeforeSupport", ({
}
});

export const hasSupportMatrixContradictions = (
export const hasSupportUpdates = (
versionMap: BrowserSupportMap,
simpleStatement?: SimpleSupportStatement,
) => {
Expand Down Expand Up @@ -972,7 +972,7 @@ export const update = (
shared: {versionMap},
defaultStatements: [simpleStatement],
}) => {
if (!hasSupportMatrixContradictions(versionMap, simpleStatement)) {
if (!hasSupportUpdates(versionMap, simpleStatement)) {
return reason(
({path, browser}) =>
`$${path} skipped for ${browser} because support matrix matches current BCD support data`,
Expand Down Expand Up @@ -1035,7 +1035,7 @@ export const update = (
shared: {versionMap},
}) => {
if (!statements?.length) {
if (hasSupportMatrixContradictions(versionMap, simpleStatement)) {
if (hasSupportUpdates(versionMap, simpleStatement)) {
return reason(
({browser, path}) =>
`${path} skipped for ${browser} with unresolved differences between support matrix and BCD data. Possible intervention required.`,
Expand Down

0 comments on commit f27f002

Please sign in to comment.