1
0
mirror of https://github.com/golang/go synced 2024-11-14 15:00:27 -07:00
go/src/cmd/fix/context_test.go
Sam Whited 22d3bf1da4 cmd/fix: add golang.org/x/net/context fix
Fixes #17040

Change-Id: I3682cc0367b919084c280d7dc64746495c1d4aaa
Reviewed-on: https://go-review.googlesource.com/28872
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-09-15 19:24:04 +00:00

43 lines
648 B
Go

// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func init() {
addTestCases(contextTests, ctxfix)
}
var contextTests = []testCase{
{
Name: "context.0",
In: `package main
import "golang.org/x/net/context"
var _ = "golang.org/x/net/context"
`,
Out: `package main
import "context"
var _ = "golang.org/x/net/context"
`,
},
{
Name: "context.1",
In: `package main
import ctx "golang.org/x/net/context"
var _ = ctx.Background()
`,
Out: `package main
import ctx "context"
var _ = ctx.Background()
`,
},
}