Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(267)

Delta Between Two Patch Sets: src/pkg/path/match_test.go

Issue 5294074: code review 5294074: src/pkg/[n-z]*: gofix -r error (Closed)
Left Patch Set: Created 13 years, 4 months ago
Right Patch Set: diff -r b78bb4f2d2a3 https://go.googlecode.com/hg/ Created 13 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/path/match.go ('k') | src/pkg/rand/rand_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 path 5 package path
6 6
7 import ( 7 import "testing"
8 » "os"
9 » "testing"
10 )
11 8
12 type MatchTest struct { 9 type MatchTest struct {
13 pattern, s string 10 pattern, s string
14 match bool 11 match bool
15 » err os.Error 12 » err error
16 } 13 }
17 14
18 var matchTests = []MatchTest{ 15 var matchTests = []MatchTest{
19 {"abc", "abc", true, nil}, 16 {"abc", "abc", true, nil},
20 {"*", "abc", true, nil}, 17 {"*", "abc", true, nil},
21 {"*c", "abc", true, nil}, 18 {"*c", "abc", true, nil},
22 {"a*", "a", true, nil}, 19 {"a*", "a", true, nil},
23 {"a*", "abc", true, nil}, 20 {"a*", "abc", true, nil},
24 {"a*", "ab/c", false, nil}, 21 {"a*", "ab/c", false, nil},
25 {"a*/b", "abc/b", true, nil}, 22 {"a*/b", "abc/b", true, nil},
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 65 }
69 66
70 func TestMatch(t *testing.T) { 67 func TestMatch(t *testing.T) {
71 for _, tt := range matchTests { 68 for _, tt := range matchTests {
72 ok, err := Match(tt.pattern, tt.s) 69 ok, err := Match(tt.pattern, tt.s)
73 if ok != tt.match || err != tt.err { 70 if ok != tt.match || err != tt.err {
74 t.Errorf("Match(%#q, %#q) = %v, %v want %v, nil", tt.pat tern, tt.s, ok, err, tt.match) 71 t.Errorf("Match(%#q, %#q) = %v, %v want %v, nil", tt.pat tern, tt.s, ok, err, tt.match)
75 } 72 }
76 } 73 }
77 } 74 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b