aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/patch/patch_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-15 15:40:16 -0800
committerRobert Griesemer <gri@golang.org>2009-12-15 15:40:16 -0800
commitd65a5cce89596e0256280ab8318548d3fa5bb09b (patch)
treea6ffc3d3f824cca65bc931bf0f045c8af78bc62b /src/pkg/patch/patch_test.go
parenta3d1045fb7b34355c9859aea2781e0d77004cc82 (diff)
downloadgo-d65a5cce89596e0256280ab8318548d3fa5bb09b.tar.xz
1) Change default gofmt default settings for
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 4th set of files. R=rsc CC=golang-dev https://golang.org/cl/180049
Diffstat (limited to 'src/pkg/patch/patch_test.go')
-rw-r--r--src/pkg/patch/patch_test.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pkg/patch/patch_test.go b/src/pkg/patch/patch_test.go
index 046ffa8828..5b3d48315f 100644
--- a/src/pkg/patch/patch_test.go
+++ b/src/pkg/patch/patch_test.go
@@ -7,31 +7,31 @@ package patch
// TODO(rsc): test Apply
import (
- "strings";
- "testing";
+ "strings"
+ "testing"
)
type Test struct {
- in string;
- out string;
- diff string;
+ in string
+ out string
+ diff string
}
func TestFileApply(t *testing.T) {
for i, test := range tests {
- set, err := Parse(strings.Bytes(test.diff));
+ set, err := Parse(strings.Bytes(test.diff))
if err != nil {
- t.Errorf("#%d: Parse: %s", i, err);
- continue;
+ t.Errorf("#%d: Parse: %s", i, err)
+ continue
}
if len(set.File) != 1 {
- t.Errorf("#%d: Parse returned %d patches, want 1", i, len(set.File));
- continue;
+ t.Errorf("#%d: Parse returned %d patches, want 1", i, len(set.File))
+ continue
}
- new, err := set.File[0].Apply(strings.Bytes(test.in));
+ new, err := set.File[0].Apply(strings.Bytes(test.in))
if err != nil {
- t.Errorf("#%d: Apply: %s", i, err);
- continue;
+ t.Errorf("#%d: Apply: %s", i, err)
+ continue
}
if s := string(new); s != test.out {
t.Errorf("#%d:\n--- have\n%s--- want\n%s", i, s, test.out)