@@ -0,0 +1,40 @@
7+def generate_snapshots():
8+ single_styles = ["changes", "grid", "header", "numbers"]
9+ collective_styles = ["full", "plain"]
11+ for num in range(len(single_styles)):
12+ for grouped in itertools.combinations(single_styles, num + 1):
13+ generate_snapshot(",".join(grouped))
15+ for style in collective_styles:
16+ generate_snapshot(style)
18+def generate_snapshot(option):
19+ command = "../../target/debug/bat --style={0} sample.rs > output/{0}.snapshot.txt".format(
22+ print("generating snapshot for {}".format(option))
23+ subprocess.call(command, shell=True)
25+def prepare_output_dir():
26+ shutil.rmtree("output", ignore_errors=True)
27+ pathlib.Path("output").mkdir()
29+def modify_sample_file():
30+ print("modifying sample.rs to show changes")
31+ shutil.copyfile("sample.modified.rs", "sample.rs")
33+def undo_sample_file_modification():
34+ print("undoing sample.rs modifications")
35+ subprocess.call("git checkout -- sample.rs", shell=True)
40+undo_sample_file_modification()