diff --git a/test/knowledge-collection-tools.test.js b/test/knowledge-collection-tools.test.js index b24cdd1..2eaeeec 100644 --- a/test/knowledge-collection-tools.test.js +++ b/test/knowledge-collection-tools.test.js @@ -112,6 +112,28 @@ describe("calculateMerkleRoot", () => { const root = calculateMerkleRoot(quads, 32); expect(root).to.match(/^0x[0-9a-f]+$/); }); + + it("should calculate merkle root with real-world example data", () => { + const quads = [ + ' "468.9 sq mi" .', + ' "New York" .', + ' "8,336,817" .', + ' "New York" .', + " .", + ' "0xaac2a420672a1eb77506c544ff01beed2be58c0ee3576fe037c846f97481cefd" .', + " .", + " .", + " .", + ]; + + const merkle_root = calculateMerkleRoot(quads); + + // Expected merkle root for this dataset + const expected_merkle_root = "0x897442f7db61619b9f272c69d787975f169d0624d7f08c216017c3218c8ea5da"; + + // Verify the result matches the expected value + expect(merkle_root).to.equal(expected_merkle_root); + }); }); describe("calculateMerkleProof", () => {