From 704486ae2e91c7d2cf8aafd3198aa18c630bd241 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Thu, 9 Jan 2025 11:27:52 +0000 Subject: [PATCH] chore(common/web): add two more test cases for ElementString.isEqual() --- .../types/tests/kmx/kmx-plus/element-string.tests.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/web/types/tests/kmx/kmx-plus/element-string.tests.ts b/common/web/types/tests/kmx/kmx-plus/element-string.tests.ts index db3fdcc535..5c8f5ce80b 100644 --- a/common/web/types/tests/kmx/kmx-plus/element-string.tests.ts +++ b/common/web/types/tests/kmx/kmx-plus/element-string.tests.ts @@ -375,6 +375,16 @@ describe('Test of ElementString', () => { const two = ElementString.fromStrings(sections, ["𐌰", "𐌱", "𐌲"]); assert.isTrue(one.isEqual(two)); }); + it('returns false when ElementStrings are different lengths', () => { + const one = ElementString.fromStrings(sections, ["𐌰", "𐌱", "𐌲"]); + const two = ElementString.fromStrings(sections, ["𐌰", "𐌱"]); + assert.isFalse(one.isEqual(two)); + }); + it('returns false when ElementStrings have different ElemElements', () => { + const one = ElementString.fromStrings(sections, ["𐌰", "𐌱", "𐌲"]); + const two = ElementString.fromStrings(sections, ["𐌰", "𐌱", "𐌳"]); + assert.isFalse(one.isEqual(two)); + }); }); }); });