LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package patch | 5 package patch |
6 | 6 |
7 // TODO(rsc): test Apply | 7 // TODO(rsc): test Apply |
8 | 8 |
9 import ( | 9 import "testing" |
10 » "strings" | |
11 » "testing" | |
12 ) | |
13 | 10 |
14 type Test struct { | 11 type Test struct { |
15 in string | 12 in string |
16 out string | 13 out string |
17 diff string | 14 diff string |
18 } | 15 } |
19 | 16 |
20 func TestFileApply(t *testing.T) { | 17 func TestFileApply(t *testing.T) { |
21 for i, test := range tests { | 18 for i, test := range tests { |
22 set, err := Parse([]byte(test.diff)) | 19 set, err := Parse([]byte(test.diff)) |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 }, | 381 }, |
385 Test{ | 382 Test{ |
386 "", | 383 "", |
387 "", | 384 "", |
388 "Index: hello\n" + | 385 "Index: hello\n" + |
389 "=======================================================
============\n" + | 386 "=======================================================
============\n" + |
390 "old mode 100644\n" + | 387 "old mode 100644\n" + |
391 "new mode 100755\n", | 388 "new mode 100755\n", |
392 }, | 389 }, |
393 } | 390 } |
LEFT | RIGHT |