Skip to content

Commit aeaf302

Browse files
committed
Fix test failure
1 parent ffb0d3b commit aeaf302

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

test/ro/redeul/google/go/inspection/FunctionCallInspectionTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ public class FunctionCallInspectionTest extends GoInspectionTestCase {
55
public void testMake() throws Exception{ doTest(); }
66
public void testNew() throws Exception{ doTest(); }
77
public void testFuncCall() throws Exception{ doTest(); }
8+
public void testBuiltinCall() throws Exception{
9+
myFixture.addFileToProject("builtin.go", "package builtin\ntype Type int\ntype Type1 int\nfunc append(slice []Type, elems ...Type) []Type\nfunc copy(dst, src []Type) int\nfunc delete(m map[Type]Type1, key Type)\n");
10+
doTest();
11+
}
812
}

test/ro/redeul/google/go/inspection/GoInspectionTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected void doTest() throws Exception {
6868

6969
@Override
7070
protected void tearDown() throws Exception {
71-
removeContentRoots();
71+
// removeContentRoots();
7272
super.tearDown();
7373
}
7474

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package main
2+
3+
func main() {
4+
// issue #480
5+
arr1 := []int{}
6+
arr2 := []string{}
7+
arr3 := []byte{}
8+
arr1 = append(arr1, 1)
9+
arr1 = append(arr1, 1, 2, 3)
10+
arr1 = append(arr1, /*begin*/1.2/*end.Expression type mismatch, the expected type is int|CastTypeFix*/)
11+
arr1 = append(arr1, /*begin*/""/*end.Expression type mismatch, the expected type is int|CastTypeFix*/)
12+
13+
copy(arr1, arr1)
14+
copy(arr1, /*begin*/arr2/*end.Expression type mismatch, the expected type is []int|CastTypeFix*/)
15+
16+
map1 := map[string]int{}
17+
delete(map1, "key")
18+
delete(map1, /*begin*/1/*end.Expression type mismatch, the expected type is string|CastTypeFix*/)
19+
20+
// This test will be broken when issue #609 is fixed
21+
arr1 = append(arr1, /*begin*/arr1/*end.Expression type mismatch, the expected type is int|CastTypeFix*/...)
22+
arr3 = append(arr3, /*begin*/"test"/*end.Expression type mismatch, the expected type is byte|CastTypeFix*/...)
23+
24+
}

testdata/inspection/functionCall/funcCall.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -464,20 +464,4 @@ func main() {
464464
myNewFnForTest := func(a string, b string) (bool,bool,bool) {return false,false,false}
465465
TestLiteralFunc(/*begin*/myNewFnForTest/*end.Expression type mismatch, the expected type is func(string,string)(bool,bool)|CastTypeFix*/)
466466
TestLiteralFunc(func(a string,b string)(bool,bool) {return false,true})
467-
468-
469-
// issue #480
470-
arr1 := []int{}
471-
arr1 = append(arr1, 1)
472-
arr1 = append(arr1, 1, 2, 3)
473-
arr1 = append(arr1, /*begin*/1.2/*end.Expression type mismatch, the expected type is int|CastTypeFix*/)
474-
arr1 = append(arr1, /*begin*/""/*end.Expression type mismatch, the expected type is int|CastTypeFix*/)
475-
arr2 := []string{}
476-
477-
copy(arr1, arr1)
478-
copy(arr1, /*begin*/arr2/*end.Expression type mismatch, the expected type is []int|CastTypeFix*/)
479-
480-
map1 := map[string]int{}
481-
delete(map1, "key")
482-
delete(map1, /*begin*/1/*end.Expression type mismatch, the expected type is string|CastTypeFix*/)
483467
}

0 commit comments

Comments
 (0)