Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move docs_are_up_to_date_test.py fix instructions into asserts #198

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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