# Add back a trailing newline so we don't need to bother
# with patching test files to include a trailing newline to
# make Git happy. Can't use keep_trailing_newline because
- # that'd add it also for nested templates :(
+ # that'd add it also for nested templates :( The rendered
+ # file should never contain a trailing newline on its own.
+ assert not rendered.endswith('\n')
f.write(b'\n')
else:
parsed = parse_xml(state, file)
# Add back a trailing newline so we don't need to bother with
# patching test files to include a trailing newline to make Git
# happy. Can't use keep_trailing_newline because that'd add it
- # also for nested templates :(
+ # also for nested templates :( The rendered file should never
+ # contain a trailing newline on its own.
+ assert not rendered.endswith('\n')
f.write(b'\n')
# Empty index page in case no mainpage documentation was provided so
# Add back a trailing newline so we don't need to bother with
# patching test files to include a trailing newline to make Git
# happy. Can't use keep_trailing_newline because that'd add it
- # also for nested templates :(
+ # also for nested templates :( The rendered file should never
+ # contain a trailing newline on its own.
+ assert not rendered.endswith('\n')
f.write(b'\n')
if not state.config['SEARCH_DISABLED']:
# Add back a trailing newline so we don't need to bother with
# patching test files to include a trailing newline to make Git
# happy. Can't use keep_trailing_newline because that'd add it
- # also for nested templates :(
+ # also for nested templates :( The rendered file should never
+ # contain a trailing newline on its own.
+ assert not rendered.endswith('\n')
f.write(b'\n')
# Copy all referenced files
# Add back a trailing newline so we don't need to bother with
# patching test files to include a trailing newline to make Git
# happy. Can't use keep_trailing_newline because that'd add it
- # also for nested templates :(
+ # also for nested templates :( The rendered file should never contain a
+ # trailing newline on its own.
+ assert not rendered.endswith('\n')
f.write(b'\n')
def render_module(state: State, path, module, env):
# Add back a trailing newline so we don't need to bother with
# patching test files to include a trailing newline to make Git
# happy. Can't use keep_trailing_newline because that'd add it
- # also for nested templates :(
+ # also for nested templates :( The rendered file should never
+ # contain a trailing newline on its own.
+ assert not rendered.endswith('\n')
f.write(b'\n')
# Copy referenced files