File: issue42134.txt

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (80 lines) | stat: -rw-r--r-- 1,727 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Regression test for #42134,
"rename fails to update doc comment for local variable of function type"

-- 1.go --
package issue42134

func _() {
	// foo computes things.
	foo := func() {}

	foo() //@rename("foo", "bar", fooTobar)
}
-- @fooTobar/1.go --
@@ -4,2 +4,2 @@
-	// foo computes things.
-	foo := func() {}
+	// bar computes things.
+	bar := func() {}
@@ -7 +7 @@
-	foo() //@rename("foo", "bar", fooTobar)
+	bar() //@rename("foo", "bar", fooTobar)
-- 2.go --
package issue42134

import "fmt"

func _() {
	// minNumber is a min number.
	// Second line.
	minNumber := min(1, 2)
	fmt.Println(minNumber) //@rename("minNumber", "res", minNumberTores)
}

func min(a, b int) int { return a + b }
-- @minNumberTores/2.go --
@@ -6 +6 @@
-	// minNumber is a min number.
+	// res is a min number.
@@ -8,2 +8,2 @@
-	minNumber := min(1, 2)
-	fmt.Println(minNumber) //@rename("minNumber", "res", minNumberTores)
+	res := min(1, 2)
+	fmt.Println(res) //@rename("minNumber", "res", minNumberTores)
-- 3.go --
package issue42134

func _() {
	/*
	tests contains test cases
	*/
	tests := []struct { //@rename("tests", "testCases", testsTotestCases)
		in, out string
	}{}
	_ = tests
}
-- @testsTotestCases/3.go --
@@ -5 +5 @@
-	tests contains test cases
+	testCases contains test cases
@@ -7 +7 @@
-	tests := []struct { //@rename("tests", "testCases", testsTotestCases)
+	testCases := []struct { //@rename("tests", "testCases", testsTotestCases)
@@ -10 +10 @@
-	_ = tests
+	_ = testCases
-- 4.go --
package issue42134

func _() {
	// a is equal to 5. Comment must stay the same

	a := 5
	_ = a //@rename("a", "b", aTob)
}
-- @aTob/4.go --
@@ -6,2 +6,2 @@
-	a := 5
-	_ = a //@rename("a", "b", aTob)
+	b := 5
+	_ = b //@rename("a", "b", aTob)