function compareFile(filename) {
    const text = fs.readFileSync(filename);
    buffer.setText(text);
    languageMode = new TreeSitterLanguageMode({ buffer, grammar });
    treeIndenter = new TreeIndenter(languageMode, jsScopes);

    for (let row = 0; row < buffer.getLineCount(); row++) {
      // get current (correct) indentation
      const line = buffer.lineForRow(row);
      const currentIndentation = languageMode.indentLevelForLine(
        line,
        TAB_LENGTH
      );

      // get suggested indentation
      const indent = treeIndenter.suggestedIndentForBufferRow(
        row,
        TAB_LENGTH,
        {}
      );

      // verify
      if (indent !== currentIndentation) {
        throw Error(
          `failure in file row ${row +
            1}: suggested ${indent} but ${currentIndentation} is correct (${line})`
        );
      } else {
        expect(indent).toEqual(currentIndentation);
      }
    }
  }
load a file from disk and verify that our proposed indentation
  is the same as it is in the file