1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:47:45 +00:00

LibJS: Implement Set.prototype.isDisjointFrom

This commit is contained in:
Idan Horowitz 2022-12-01 23:00:44 +02:00 committed by Linus Groh
parent 3470f33a0f
commit 2e806dab07
4 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,9 @@
test("basic functionality", () => {
expect(Set.prototype.isDisjointFrom).toHaveLength(1);
const set1 = new Set(["a", "b"]);
const set2 = new Set(["c"]);
expect(set1.isDisjointFrom(set1)).toBeFalse();
expect(set1.isDisjointFrom(set2)).toBeTrue();
expect(set2.isDisjointFrom(set1)).toBeTrue();
});