Skip to content

Commit

Permalink
Fix README test.
Browse files Browse the repository at this point in the history
  • Loading branch information
calder committed Apr 16, 2024
1 parent caab87d commit 837b4ed
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 9 deletions.
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
exclude: |
(?x)^(tests/.*/.*\.(out|parse))$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: local
hooks:
- id: cargo-fmt
name: Cargo fmt
description: Run cargo fmt.
entry: cargo fmt
language: system
types: [rust]
pass_filenames: false
- id: cargo-test
name: Cargo test
description: Run cargo test.
entry: cargo test
language: system
types: [rust]
pass_filenames: false
- id: clippy
name: Clippy
description: Run clippy.
entry: cargo clippy
language: system
args: ["--", "-D", "warnings"]
types: [rust]
pass_filenames: false
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fn test() {
let mut file1 = mint.new_goldenfile("file1.txt").unwrap();
let mut file2 = mint.new_goldenfile("file2.txt").unwrap();

write!(file1, "Hello world!").unwrap();
write!(file2, "Foo bar!").unwrap();
writeln!(file1, "Hello world!").unwrap();
writeln!(file2, "Foo bar!").unwrap();
}
```

Expand Down
2 changes: 1 addition & 1 deletion tests/goldenfiles/file1.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Hello world!
Hello world!
2 changes: 1 addition & 1 deletion tests/goldenfiles/file2.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Foo bar!
Foo bar!
2 changes: 1 addition & 1 deletion tests/goldenfiles/panic.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
old
old
2 changes: 1 addition & 1 deletion tests/goldenfiles/update1.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Hello world!
Hello world!
2 changes: 1 addition & 1 deletion tests/goldenfiles/update2.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
foobar
foobar
4 changes: 2 additions & 2 deletions tests/readme_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ fn test() {
let mut file1 = mint.new_goldenfile("file1.txt").unwrap();
let mut file2 = mint.new_goldenfile("file2.txt").unwrap();

write!(file1, "Hello world!").unwrap();
write!(file2, "Foo bar!").unwrap();
writeln!(file1, "Hello world!").unwrap();
writeln!(file2, "Foo bar!").unwrap();
}

0 comments on commit 837b4ed

Please sign in to comment.