function checkBlocks(returned, expected) {
    const showBlocks = () => {
      return (
        "\nreturned: " +
        JSON.stringify(returned, null, 2) +
        "\n" +
        "expected: " +
        JSON.stringify(expected, null, 2)
      );
    };

    assert.equal(
      expected.lines.length,
      returned.lines.length,
      "Number of lines does not match, " + showBlocks()
    );

    for (let i = 0; i < returned.lines.length; ++i) {
      const retLine = returned.lines[i];
      const expLine = expected.lines[i];

      assert(
        retLine.blocks.length === expLine.blocks.length,
        "Number of blocks does not match, " + showBlocks()
      );
      for (let j = 0; j < retLine.blocks.length; ++j) {
        const retBlock = retLine.blocks[j];
        const expBlock = expLine.blocks[j];

        assert(
          retBlock.text === expBlock.text,
          "Text does not match, " + showBlocks()
        );

        assert(retBlock.mod !== undefined);
        if (retBlock.mod === "normal" || retBlock.mod === "") {
          assert(
            expBlock.mod === undefined ||
              expBlock.mod === "normal" ||
              expBlock === "",
            "No mod field expected in returned, " + showBlocks()
          );
        } else {
          assert(
            retBlock.mod === expBlock.mod,
            "Mod fields do not match, line: " +
              i +
              ", block: " +
              j +
              "; ret: " +
              retBlock.mod +
              ", exp: " +
              expBlock.mod +
              "\n" +
              showBlocks()
          );
        }
      }
    }
  }
Check if the returned lines and blocks are as expected.

All width/height fields and font info are ignored.
Within blocks, only the text is compared
@param returned
@param expected