summaryrefslogtreecommitdiff
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
commit13ac778ef2f757c7cd636b4336a2bd6c8f403b43 (patch)
tree28b6ebc4aa762e38c45f4b0b69d3aee472ed4c3c /src/pkg/patch/patch_test.go
parente4bd81f903362d998f7bfc02095935408aff0bc5 (diff)
downloadgolang-13ac778ef2f757c7cd636b4336a2bd6c8f403b43.tar.gz
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 http://codereview.appspot.com/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 046ffa882..5b3d48315 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)