diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-24 18:55:04 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-24 19:04:50 +0300 |
commit | 79c8df044deafe4463bedd7f87571d2ac1ba48ba (patch) | |
tree | c26484d0275de3a74552a6c7cc57b7455e5ca5c0 /subplot.py | |
parent | e889ebdef94434109e63847e39d0c979569c44c0 (diff) | |
download | subplot-79c8df044deafe4463bedd7f87571d2ac1ba48ba.tar.gz |
test: add scenarios to verify newline adding to embedded files
Diffstat (limited to 'subplot.py')
-rw-r--r-- | subplot.py | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -107,5 +107,24 @@ def json_output_matches_file(ctx, filename=None): assert_dict_eq(actual, expected) +def file_ends_in_zero_newlines(ctx, filename=None): + content = open(filename, "r").read() + print("content:", repr(content)) + assert_ne(content[-1], "\n") + + +def file_ends_in_one_newline(ctx, filename=None): + content = open(filename, "r").read() + print("content:", repr(content)) + assert_eq(content[-1], "\n") + assert_ne(content[-2], "\n") + + +def file_ends_in_two_newlines(ctx, filename=None): + content = open(filename, "r").read() + print("content:", repr(content)) + assert_eq(content[-2:], "\n\n") + + def binary(basename): return os.path.join(srcdir, "target", "debug", basename) |