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

Delta Between Two Patch Sets: src/cmd/gofix/url_test.go

Issue 4893043: code review 4893043: url: new package (Closed)
Left Patch Set: diff -r a6bbe1b3fb7d https://go.googlecode.com/hg/ Created 13 years, 8 months ago
Right Patch Set: diff -r a8d309fd526f https://go.googlecode.com/hg/ Created 13 years, 8 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gofix/url.go ('k') | src/pkg/Makefile » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 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 main 5 package main
6 6
7 func init() { 7 func init() {
8 addTestCases(urlTests) 8 addTestCases(urlTests)
dsymonds 2011/08/16 06:36:28 any worry about code like this? type url string
rsc 2011/08/16 19:45:51 Won't that just work?
9 } 9 }
10 10
11 var urlTests = []testCase{ 11 var urlTests = []testCase{
12 { 12 {
13 Name: "url.0", 13 Name: "url.0",
14 In: `package main 14 In: `package main
15 15
16 import ( 16 import (
17 "http" 17 "http"
18 ) 18 )
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 In: `package main 116 In: `package main
117 117
118 import "http" 118 import "http"
119 119
120 type U struct{ url string } 120 type U struct{ url string }
121 121
122 func f() { 122 func f() {
123 var u U 123 var u U
124 u.url = "x" 124 u.url = "x"
125 } 125 }
126
127 func (url *T) m() string {
128 return url
129 }
126 `, 130 `,
127 Out: `package main 131 Out: `package main
128 132
129 import "http" 133 import "http"
130 134
131 type U struct{ url string } 135 type U struct{ url string }
132 136
133 func f() { 137 func f() {
134 var u U 138 var u U
135 u.url = "x" 139 u.url = "x"
136 } 140 }
141
142 func (url *T) m() string {
143 return url
144 }
137 `, 145 `,
138 }, 146 },
139 } 147 }
LEFTRIGHT

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