> You can test the reading of /etc/hosts instead of the reading of > /etc/resolv.conf. ...
11 years, 6 months ago
(2013-10-23 17:55:33 UTC)
#4
> You can test the reading of /etc/hosts instead of the reading of
> /etc/resolv.conf. See TestLookupStaticHost.
Oh great, I missed that. Thanks. Coming soon...
-josh
11 years, 6 months ago
(2013-10-23 18:18:24 UTC)
#7
On 2013/10/23 18:17:10, bradfitz wrote:
> https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go
> File src/pkg/net/hosts_test.go (right):
>
>
https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go#...
> src/pkg/net/hosts_test.go:68: hostsPath = p
> nit that probably doesn't matter: this isn't restored if the goroutine dies
with
> runtime.Goexist (via t.Fatalf) above.
>
> but you could instead do, at the top:
>
> defer func(orig string) {
> hostsPath = orig
> }(hostsPath)
> hostsPath = "testdata/hosts_singleline"
Yeah, I noticed that and couldn't decide whether it mattered. Since you noticed
too, I'll do it. :)
> you can avoid brad's comment about Fatalf by merging the tests: The other test ...
11 years, 6 months ago
(2013-10-23 18:22:13 UTC)
#9
> you can avoid brad's comment about Fatalf by merging the tests:
The other test has the same problem (there's a return in the middle of
it). Will merge the tests and fix the problem.
Fixed the corresponding problem in TestLookupStaticHost; kept the defer for TestSingleLineHostsFile for symmetry. Merged the ...
11 years, 6 months ago
(2013-10-23 18:29:21 UTC)
#10
Fixed the corresponding problem in TestLookupStaticHost; kept the
defer for TestSingleLineHostsFile for symmetry. Merged the tests in
TestSingleLineHostsFile per rsc anyway, since it reads better. Thanks!
Please take another look.
On Wed, Oct 23, 2013 at 11:21 AM, Josh Bleecher Snyder
<josharian@gmail.com> wrote:
>> you can avoid brad's comment about Fatalf by merging the tests:
>
> The other test has the same problem (there's a return in the middle of
> it). Will merge the tests and fix the problem.
On Wed, Oct 23, 2013 at 11:32 AM, Russ Cox <rsc@golang.org> wrote: > The other ...
11 years, 6 months ago
(2013-10-23 18:36:06 UTC)
#14
On Wed, Oct 23, 2013 at 11:32 AM, Russ Cox <rsc@golang.org> wrote:
> The other test did not have the problem, because it did not call Fatalf.
>
It used return, though. Maybe it should be continue.
Third time's a charm? Please take another look. > this is unnecessarily complex; please put ...
11 years, 6 months ago
(2013-10-23 18:52:46 UTC)
#15
Third time's a charm? Please take another look.
> this is unnecessarily complex; please put it back the way it was.
Done.
> It used return, though. Maybe it should be continue.
continue looks right, and tests out ok locally. Will send a separate
CL for that, to keep this one on topic.
-josh
On 2013/10/23 18:52:46, josharian wrote: > Third time's a charm? Please take another look. > ...
11 years, 6 months ago
(2013-10-24 22:11:15 UTC)
#16
On 2013/10/23 18:52:46, josharian wrote:
> Third time's a charm? Please take another look.
>
>
> > this is unnecessarily complex; please put it back the way it was.
>
> Done.
>
>
> > It used return, though. Maybe it should be continue.
>
> continue looks right, and tests out ok locally. Will send a separate
> CL for that, to keep this one on topic.
>
>
> -josh
I finally won the Rietveld lottery and no longer have old chunk mismatches on
this. Sorry about the delay.
-josh
Issue 15960047: code review 15960047: net: handle single-line non-\n-terminated files correct...
(Closed)
Created 11 years, 6 months ago by josharian
Modified 11 years, 5 months ago
Reviewers:
Base URL:
Comments: 4