mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 03:52:01 +02:00
vanilla 19.0
This commit is contained in:
parent
991d2234ca
commit
d1963a3c3a
3066 changed files with 1651266 additions and 922560 deletions
|
|
@ -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
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue