Skip to content

Use colors in snapshot tests #143

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

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ anstyle = "1.0.4"
unicode-width = "0.1.11"

[dev-dependencies]
annotate-snippets = { path = ".", features = ["testing-colors"] }
anstream = "0.6.13"
criterion = "0.5.1"
difference = "2.0.0"
Expand Down
36 changes: 36 additions & 0 deletions tests/fixtures/color/ann_eof.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ origin = "Cargo.toml"
label = ""
level = "Error"
range = [4, 4]

[renderer]
color = true
36 changes: 36 additions & 0 deletions tests/fixtures/color/ann_insertion.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ origin = "Cargo.toml"
label = "'d' belongs here"
level = "Error"
range = [2, 2]

[renderer]
color = true
42 changes: 42 additions & 0 deletions tests/fixtures/color/ann_multiline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ fold = false
label = "missing fields `lineno`, `content`"
level = "Error"
range = [31, 128]

[renderer]
color = true
40 changes: 40 additions & 0 deletions tests/fixtures/color/ann_multiline2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ fold = false
label = "this should not be on separate lines"
level = "Error"
range = [11, 19]

[renderer]
color = true
36 changes: 36 additions & 0 deletions tests/fixtures/color/ann_removed_nl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ origin = "Cargo.toml"
label = ""
level = "Error"
range = [4, 5]

[renderer]
color = true
36 changes: 36 additions & 0 deletions tests/fixtures/color/ensure-emoji-highlight-width.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ origin = "<file>"
label = ""
level = "Error"
range = [0, 35]

[renderer]
color = true
49 changes: 49 additions & 0 deletions tests/fixtures/color/fold_ann_multiline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ range = [5, 19]
label = "expected enum `std::option::Option`, found ()"
level = "Error"
range = [22, 766]

[renderer]
color = true
37 changes: 37 additions & 0 deletions tests/fixtures/color/fold_bad_origin_line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ fold = true
label = "error here"
level = "Warning"
range = [2,16]

[renderer]
color = true
Loading
Loading