Skip to content

Commit

Permalink
Move docs_are_up_to_date_test.py fix instructions into asserts (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
reventlov authored Oct 7, 2024
1 parent 886cfbb commit cefa726
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions compiler/front_end/docs_are_up_to_date_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ class DocsAreUpToDateTest(unittest.TestCase):
def test_grammar_md(self):
doc_md = pkgutil.get_data("doc", "grammar.md").decode(encoding="UTF-8")
correct_md = generate_grammar_md.generate_grammar_md()
# If this fails, run:
#
# bazel run //compiler/front_end:generate_grammar_md > doc/grammar.md
#
# Be sure to check that the results look good before committing!
msg = "Run:\n\nbazel run //compiler/front_end:generate_grammar_md > doc/grammar.md"
doc_md_lines = doc_md.splitlines()
correct_md_lines = correct_md.splitlines()
for i in range(len(doc_md_lines)):
self.assertEqual(correct_md_lines[i], doc_md_lines[i])
self.assertEqual(correct_md, doc_md)
self.assertEqual(correct_md_lines[i], doc_md_lines[i], msg=msg)
self.assertEqual(correct_md, doc_md, msg=msg)


if __name__ == "__main__":
Expand Down

0 comments on commit cefa726

Please sign in to comment.