summaryrefslogtreecommitdiffstats
path: root/tests/snapshots
diff options
context:
space:
mode:
authoreth-p <32112321+eth-p@users.noreply.github.com>2018-09-11 13:47:01 -0700
committereth-p <32112321+eth-p@users.noreply.github.com>2018-09-11 13:47:01 -0700
commitc1e1f753cfdae56dc3777e6e512bdb0b56ef3750 (patch)
tree5545f8f8cb85593983197e61269d58a36c507cf9 /tests/snapshots
parentd90797f8e947f01da74fd2aa065f48df3e50ab0b (diff)
Added three new snapshot tests for --tabs and --wrap.
Diffstat (limited to 'tests/snapshots')
-rwxr-xr-xtests/snapshots/generate_snapshots.py9
-rw-r--r--tests/snapshots/output/tabs_4_wrapped.snapshot.txt40
-rw-r--r--tests/snapshots/output/tabs_8_wrapped.snapshot.txt40
-rw-r--r--tests/snapshots/output/tabs_passthrough_wrapped.snapshot.txt40
4 files changed, 126 insertions, 3 deletions
diff --git a/tests/snapshots/generate_snapshots.py b/tests/snapshots/generate_snapshots.py
index ea130a4f..7a4798ff 100755
--- a/tests/snapshots/generate_snapshots.py
+++ b/tests/snapshots/generate_snapshots.py
@@ -15,9 +15,12 @@ def generate_snapshots():
for style in collective_styles:
generate_style_snapshot(style)
- generate_snapshot("tabs_passthrough", "--tabs=0 --style=full")
- generate_snapshot("tabs_4", "--tabs=4 --style=full")
- generate_snapshot("tabs_8", "--tabs=8 --style=full")
+ generate_snapshot("tabs_passthrough", "--tabs=0 --style=full --wrap=never")
+ generate_snapshot("tabs_passthrough_wrapped", "--tabs=0 --style=full --wrap=character")
+ generate_snapshot("tabs_4", "--tabs=4 --style=full --wrap=never")
+ generate_snapshot("tabs_4_wrapped", "--tabs=4 --style=full --wrap=character")
+ generate_snapshot("tabs_8", "--tabs=8 --style=full --wrap=never")
+ generate_snapshot("tabs_8_wrapped", "--tabs=8 --style=full --wrap=character")
def generate_style_snapshot(style):
generate_snapshot(style.replace(",","_"), "--style={}".format(style))
diff --git a/tests/snapshots/output/tabs_4_wrapped.snapshot.txt b/tests/snapshots/output/tabs_4_wrapped.snapshot.txt
new file mode 100644
index 00000000..87689c7b
--- /dev/null
+++ b/tests/snapshots/output/tabs_4_wrapped.snapshot.txt
@@ -0,0 +1,40 @@
+───────┬────────────────────────────────────────────────────────────────────────
+ │ File: sample.rs
+───────┼────────────────────────────────────────────────────────────────────────
+ 1 │ struct Rectangle {
+ 2 │ width: u32,
+ 3 │ height: u32,
+ 4 │ }
+ 5 │
+ 6 _ │ fn main() {
+ 7 │ let rect1 = Rectangle { width: 30, height: 50 };
+ 8 │
+ 9 │ println!(
+ 10 ~ │ "The perimeter of the rectangle is {} pixels.",
+ 11 ~ │ perimeter(&rect1)
+ 12 │ );
+ 13 + │ println!(r#"This line contains invalid utf8: "�����"#;
+ 14 │ }
+ 15 │
+ 16 │ fn area(rectangle: &Rectangle) -> u32 {
+ 17 │ rectangle.width * rectangle.height
+ 18 │ }
+ 19 │
+ 20 + │ fn perimeter(rectangle: &Rectangle) -> u32 {
+ 21 + │ (rectangle.width + rectangle.height) * 2
+ 22 + │ }
+ 23 + │
+ 24 │ // Tab alignment:
+ 25 │ /*
+ 26 │ Indent
+ 27 │ 1 2 3 4
+ 28 │ 1 ?
+ 29 │ 22 ?
+ 30 │ 333 ?
+ 31 │ 4444 ?
+ 32 │ 55555 ?
+ 33 │ 666666 ?
+ 34 │ 7777777 ?
+ 35 │ 88888888 ?
+ 36 ~ │ */
+───────┴────────────────────────────────────────────────────────────────────────
diff --git a/tests/snapshots/output/tabs_8_wrapped.snapshot.txt b/tests/snapshots/output/tabs_8_wrapped.snapshot.txt
new file mode 100644
index 00000000..221306da
--- /dev/null
+++ b/tests/snapshots/output/tabs_8_wrapped.snapshot.txt
@@ -0,0 +1,40 @@
+───────┬────────────────────────────────────────────────────────────────────────
+ │ File: sample.rs
+───────┼────────────────────────────────────────────────────────────────────────
+ 1 │ struct Rectangle {
+ 2 │ width: u32,
+ 3 │ height: u32,
+ 4 │ }
+ 5 │
+ 6 _ │ fn main() {
+ 7 │ let rect1 = Rectangle { width: 30, height: 50 };
+ 8 │
+ 9 │ println!(
+ 10 ~ │ "The perimeter of the rectangle is {} pixels.",
+ 11 ~ │ perimeter(&rect1)
+ 12 │ );
+ 13 + │ println!(r#"This line contains invalid utf8: "�����"#;
+ 14 │ }
+ 15 │
+ 16 │ fn area(rectangle: &Rectangle) -> u32 {
+ 17 │ rectangle.width * rectangle.height
+ 18 │ }
+ 19 │
+ 20 + │ fn perimeter(rectangle: &Rectangle) -> u32 {
+ 21 + │ (rectangle.width + rectangle.height) * 2
+ 22 + │ }
+ 23 + │
+ 24 │ // Tab alignment:
+ 25 │ /*
+ 26 │ Indent
+ 27 │ 1 2 3 4
+ 28 │ 1 ?
+ 29 │ 22 ?
+ 30 │ 333 ?
+ 31 │ 4444 ?
+ 32 │ 55555 ?
+ 33 │ 666666 ?
+ 34 │ 7777777 ?
+ 35 │ 88888888 ?
+ 36 ~ │ */
+───────┴────────────────────────────────────────────────────────────────────────
diff --git a/tests/snapshots/output/tabs_passthrough_wrapped.snapshot.txt b/tests/snapshots/output/tabs_passthrough_wrapped.snapshot.txt
new file mode 100644
index 00000000..3ad018a1
--- /dev/null
+++ b/tests/snapshots/output/tabs_passthrough_wrapped.snapshot.txt
@@ -0,0 +1,40 @@
+───────┬────────────────────────────────────────────────────────────────────────
+ │ File: sample.rs
+───────┼────────────────────────────────────────────────────────────────────────
+ 1 │ struct Rectangle {
+ 2 │ width: u32,
+ 3 │ height: u32,
+ 4 │ }
+ 5 │
+ 6 _ │ fn main() {
+ 7 │ let rect1 = Rectangle { width: 30, height: 50 };
+ 8 │
+ 9 │ println!(
+ 10 ~ │ "The perimeter of the rectangle is {} pixels.",
+ 11 ~ │ perimeter(&rect1)
+ 12 │ );
+ 13 + │ println!(r#"This line contains invalid utf8: "�����"#;
+ 14 │ }
+ 15 │
+ 16 │ fn area(rectangle: &Rectangle) -> u32 {
+ 17 │ rectangle.width * rectangle.height
+ 18 │ }
+ 19 │
+ 20 + │ fn perimeter(rectangle: &Rectangle) -> u32 {
+ 21 + │ (rectangle.width + rectangle.height) * 2
+ 22 + │ }
+ 23 + │
+ 24 │ // Tab alignment:
+ 25 │ /*
+ 26 │ Indent
+ 27 │ 1 2 3 4
+ 28 │ 1 ?
+ 29 │ 22 ?
+ 30 │ 333 ?
+ 31 │ 4444 ?
+ 32 │ 55555 ?
+ 33 │ 666666 ?
+ 34 │ 7777777 ?
+ 35 │ 88888888 ?
+ 36 ~ │ */
+───────┴────────────────────────────────────────────────────────────────────────