Skip to content

Commit adce750

Browse files
committed
add testscript showing current -d diff behavior
That is, it currenty succeeds whether or not there is a diff.
1 parent a501ae3 commit adce750

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

testdata/script/diff.txtar

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# gofumpt fails with -d if there is a diff (TODO).
2+
3+
exec gofumpt -d good.go
4+
! stdout .
5+
! stderr .
6+
7+
exec gofumpt -d bad.go
8+
cmp stdout bad.go.diff
9+
! stderr .
10+
11+
-- good.go --
12+
package p
13+
14+
func f() {
15+
println("well formatted")
16+
}
17+
-- bad.go --
18+
package p
19+
20+
func f() {
21+
println("not well formatted")
22+
}
23+
-- bad.go.diff --
24+
diff bad.go.orig bad.go
25+
--- bad.go.orig
26+
+++ bad.go
27+
@@ -1,5 +1,5 @@
28+
package p
29+
30+
func f() {
31+
-println("not well formatted")
32+
+ println("not well formatted")
33+
}

0 commit comments

Comments
 (0)