From beead8e61405628ac6de9362145655405fb6452a Mon Sep 17 00:00:00 2001 From: evykassirer Date: Tue, 31 Oct 2023 11:13:24 -0700 Subject: [PATCH] lazy set: Increase code coverage. This was pvreviously covered by tests for the buddy list. We shouldn't rely on other code to complete code coverage for this module. In the future it would be good to add more tests to the lazy set tests to directly cover lazy set functionality. --- web/tests/lazy_set.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/tests/lazy_set.test.js b/web/tests/lazy_set.test.js index cc0b72c2b6..daba6ea8de 100644 --- a/web/tests/lazy_set.test.js +++ b/web/tests/lazy_set.test.js @@ -23,6 +23,14 @@ run_test("map", () => { ); }); +run_test("size", () => { + const ls = new LazySet([1, 2]); + assert.deepEqual(ls.size, 2); + + ls._make_set(); + assert.deepEqual(ls.size, 2); +}); + run_test("conversions", () => { blueslip.expect("error", "not a number", 2); const ls = new LazySet([1, 2]);