vanilla 19.0

This commit is contained in:
Ernad Husremovic 2025-10-08 10:49:46 +02:00
parent 991d2234ca
commit d1963a3c3a
3066 changed files with 1651266 additions and 922560 deletions

View file

@ -0,0 +1,33 @@
import { describe, expect, test } from "@odoo/hoot";
import { difference } from "@web/polyfills/set";
describe.current.tags("headless");
test("set difference", () => {
function test(s1, s2) {
let result;
try {
result = s1.difference(s2);
} catch {
expect(() => difference.call(s1, s2)).toThrow();
return;
}
expect(difference.call(s1, s2)).toEqual(result);
}
test(new Set([1, 2, 3]), new Set([])); // [1, 2, 3]
test(new Set([1, 2, 3]), new Set([1])); // [2, 3]
test(new Set([1, 2, 3]), new Set([1, 2, 3])); // []
test(new Set([1, 2, 3]), new Set([1, 2, 3, 5])); // []
test(new Set([1, 2, 3]), new Set([5, 6])); // []
test(new Set([]), new Set([1, 2, 3, 5])); // []
test(new Set([])); // throws
test(new Set([]), []); // throws
test(new Set([]), {}); // throws
test(new Set([]), 2); // throws
test(new Set([1])); // throws
test(new Set([1]), []); // throws
test(new Set([1]), {}); // throws
test(new Set([1]), 2); // throws
});