try improve performance
This commit is contained in:
@ -112,38 +112,46 @@ describe('canMerge', () => {
|
||||
it("should have 0 distance", () => {
|
||||
const a = {
|
||||
ids: "a",
|
||||
keys: 1
|
||||
};
|
||||
const b = {
|
||||
ids: "a",
|
||||
keys: 1
|
||||
};
|
||||
expect(canMergeFilters(a, b)).toEqual(true);
|
||||
});
|
||||
it("should have 1 distance", () => {
|
||||
const a = {
|
||||
ids: "a",
|
||||
keys: 1
|
||||
};
|
||||
const b = {
|
||||
ids: "b",
|
||||
keys: 1
|
||||
};
|
||||
expect(canMergeFilters(a, b)).toEqual(true);
|
||||
});
|
||||
it("should have 10 distance", () => {
|
||||
const a = {
|
||||
ids: "a",
|
||||
keys: 1
|
||||
};
|
||||
const b = {
|
||||
ids: "a",
|
||||
kinds: 1,
|
||||
keys: 2
|
||||
};
|
||||
expect(canMergeFilters(a, b)).toEqual(false);
|
||||
});
|
||||
it("should have 11 distance", () => {
|
||||
const a = {
|
||||
ids: "a",
|
||||
keys: 1
|
||||
};
|
||||
const b = {
|
||||
ids: "b",
|
||||
kinds: 1,
|
||||
keys: 2
|
||||
};
|
||||
expect(canMergeFilters(a, b)).toEqual(false);
|
||||
});
|
||||
@ -152,13 +160,13 @@ describe('canMerge', () => {
|
||||
since: 1,
|
||||
until: 100,
|
||||
kinds: [1],
|
||||
authors: ["kieran", "snort", "c", "d", "e"],
|
||||
authors: ["kieran", "snort", "c", "d", "e"]
|
||||
};
|
||||
const b = {
|
||||
since: 1,
|
||||
until: 100,
|
||||
kinds: [6969],
|
||||
authors: ["kieran", "snort", "c", "d", "e"],
|
||||
authors: ["kieran", "snort", "c", "d", "e"]
|
||||
};
|
||||
expect(canMergeFilters(a, b)).toEqual(true);
|
||||
});
|
||||
@ -167,14 +175,14 @@ describe('canMerge', () => {
|
||||
since: 1,
|
||||
until: 100,
|
||||
kinds: [1],
|
||||
authors: ["f", "kieran", "snort", "c", "d"],
|
||||
authors: ["f", "kieran", "snort", "c", "d"]
|
||||
};
|
||||
const b = {
|
||||
since: 1,
|
||||
until: 100,
|
||||
kinds: [1],
|
||||
authors: ["kieran", "snort", "c", "d", "e"],
|
||||
authors: ["kieran", "snort", "c", "d", "e"]
|
||||
};
|
||||
expect(canMergeFilters(a, b)).toEqual(true);
|
||||
});
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user