Skip to content

Commit

Permalink
add escape
Browse files Browse the repository at this point in the history
  • Loading branch information
sivchari committed Sep 18, 2021
1 parent 0da8554 commit bfe0636
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions testdata/src/a/a_test.go
Expand Up @@ -20,20 +20,20 @@ func setup() {

func TestF(t *testing.T) {
setup()
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `t.Setenv()` in TestF"
if err := os.Setenv("a", "b"); err != nil { // want "os.Setenv() can be replaced by `t.Setenv()` in TestF"
os.Setenv("a", "b") // want "os\\.Setenv\\(\\) can be replaced by `t\\.Setenv\\(\\)` in TestF"
if err := os.Setenv("a", "b"); err != nil { // want "os\\.Setenv\\(\\) can be replaced by `t\\.Setenv\\(\\)` in TestF"
_ = err
}
}

func BenchmarkF(b *testing.B) {
testTB(b)
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `b.Setenv()` in BenchmarkF"
if err := os.Setenv("a", "b"); err != nil { // want "os.Setenv() can be replaced by `b.Setenv()` in BenchmarkF"
os.Setenv("a", "b") // want "os\\.Setenv\\(\\) can be replaced by `b\\.Setenv\\(\\)` in BenchmarkF"
if err := os.Setenv("a", "b"); err != nil { // want "os\\.Setenv\\(\\) can be replaced by `b\\.Setenv\\(\\)` in BenchmarkF"
_ = err
}
}

func testTB(tb testing.TB) {
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `tb.Setenv()` in testTB"
os.Setenv("a", "b") // want "os\\.Setenv\\(\\) can be replaced by `tb\\.Setenv\\(\\)` in testTB"
}

0 comments on commit bfe0636

Please sign in to comment.