|
| 1 | +//golangcitest:args -Eexptostd |
| 2 | +package testdata |
| 3 | + |
| 4 | +/* |
| 5 | + #include <stdio.h> |
| 6 | + #include <stdlib.h> |
| 7 | +
|
| 8 | + void myprint(char* s) { |
| 9 | + printf("%d\n", s); |
| 10 | + } |
| 11 | +*/ |
| 12 | +import "C" |
| 13 | + |
| 14 | +import ( |
| 15 | + "fmt" |
| 16 | + "unsafe" |
| 17 | + |
| 18 | + "golang.org/x/exp/maps" |
| 19 | + "golang.org/x/exp/slices" |
| 20 | +) |
| 21 | + |
| 22 | +func _() { |
| 23 | + cs := C.CString("Hello from stdio\n") |
| 24 | + C.myprint(cs) |
| 25 | + C.free(unsafe.Pointer(cs)) |
| 26 | +} |
| 27 | + |
| 28 | +func _(m, a map[string]string) { |
| 29 | + maps.Clone(m) // want `golang.org/x/exp/maps.Clone\(\) can be replaced by maps.Clone\(\)` |
| 30 | + |
| 31 | + maps.Equal(m, a) // want `golang.org/x/exp/maps.Equal\(\) can be replaced by maps.Equal\(\)` |
| 32 | + |
| 33 | + maps.EqualFunc(m, a, func(i, j string) bool { // want `golang.org/x/exp/maps.EqualFunc\(\) can be replaced by maps.EqualFunc\(\)` |
| 34 | + return true |
| 35 | + }) |
| 36 | + |
| 37 | + maps.Copy(m, a) // want `golang.org/x/exp/maps.Copy\(\) can be replaced by maps.Copy\(\)` |
| 38 | + |
| 39 | + maps.DeleteFunc(m, func(_, _ string) bool { // want `golang.org/x/exp/maps.DeleteFunc\(\) can be replaced by maps.DeleteFunc\(\)` |
| 40 | + return true |
| 41 | + }) |
| 42 | + |
| 43 | + maps.Clear(m) // want `golang.org/x/exp/maps.Clear\(\) can be replaced by clear\(\)` |
| 44 | + |
| 45 | + fmt.Println("Hello") |
| 46 | +} |
| 47 | + |
| 48 | +func _(a, b []string) { |
| 49 | + slices.Equal(a, b) // want `golang.org/x/exp/slices\.Equal\(\) can be replaced by slices\.Equal\(\)` |
| 50 | + slices.EqualFunc(a, b, func(_ string, _ string) bool { // want `golang.org/x/exp/slices\.EqualFunc\(\) can be replaced by slices\.EqualFunc\(\)` |
| 51 | + return true |
| 52 | + }) |
| 53 | + slices.Compare(a, b) // want `golang.org/x/exp/slices\.Compare\(\) can be replaced by slices\.Compare\(\)` |
| 54 | + slices.CompareFunc(a, b, func(_ string, _ string) int { // want `golang.org/x/exp/slices\.CompareFunc\(\) can be replaced by slices\.CompareFunc\(\)` |
| 55 | + return 0 |
| 56 | + }) |
| 57 | + slices.Index(a, "a") // want `golang.org/x/exp/slices\.Index\(\) can be replaced by slices\.Index\(\)` |
| 58 | + slices.IndexFunc(a, func(_ string) bool { // want `golang.org/x/exp/slices\.IndexFunc\(\) can be replaced by slices\.IndexFunc\(\)` |
| 59 | + return true |
| 60 | + }) |
| 61 | + slices.Contains(a, "a") // want `golang.org/x/exp/slices\.Contains\(\) can be replaced by slices\.Contains\(\)` |
| 62 | + slices.ContainsFunc(a, func(_ string) bool { // want `golang.org/x/exp/slices\.ContainsFunc\(\) can be replaced by slices\.ContainsFunc\(\)` |
| 63 | + return true |
| 64 | + }) |
| 65 | + slices.Insert(a, 0, "a", "b") // want `golang.org/x/exp/slices\.Insert\(\) can be replaced by slices\.Insert\(\)` |
| 66 | + slices.Delete(a, 0, 1) // want `golang.org/x/exp/slices\.Delete\(\) can be replaced by slices\.Delete\(\)` |
| 67 | + slices.DeleteFunc(a, func(_ string) bool { // want `golang.org/x/exp/slices\.DeleteFunc\(\) can be replaced by slices\.DeleteFunc\(\)` |
| 68 | + return true |
| 69 | + }) |
| 70 | + slices.Replace(a, 0, 1, "a") // want `golang.org/x/exp/slices\.Replace\(\) can be replaced by slices\.Replace\(\)` |
| 71 | + slices.Clone(a) // want `golang.org/x/exp/slices\.Clone\(\) can be replaced by slices\.Clone\(\)` |
| 72 | + slices.Compact(a) // want `golang.org/x/exp/slices\.Compact\(\) can be replaced by slices\.Compact\(\)` |
| 73 | + slices.CompactFunc(a, func(_ string, _ string) bool { // want `golang.org/x/exp/slices\.CompactFunc\(\) can be replaced by slices\.CompactFunc\(\)` |
| 74 | + return true |
| 75 | + }) |
| 76 | + slices.Grow(a, 2) // want `golang.org/x/exp/slices\.Grow\(\) can be replaced by slices\.Grow\(\)` |
| 77 | + slices.Clip(a) // want `golang.org/x/exp/slices\.Clip\(\) can be replaced by slices\.Clip\(\)` |
| 78 | + slices.Reverse(a) // want `golang.org/x/exp/slices\.Reverse\(\) can be replaced by slices\.Reverse\(\)` |
| 79 | + slices.Sort(a) // want `golang.org/x/exp/slices\.Sort\(\) can be replaced by slices\.Sort\(\)` |
| 80 | + slices.SortFunc(a, func(_, _ string) int { // want `golang.org/x/exp/slices\.SortFunc\(\) can be replaced by slices\.SortFunc\(\)` |
| 81 | + return 0 |
| 82 | + }) |
| 83 | + slices.SortStableFunc(a, func(_, _ string) int { // want `golang.org/x/exp/slices\.SortStableFunc\(\) can be replaced by slices\.SortStableFunc\(\)` |
| 84 | + return 0 |
| 85 | + }) |
| 86 | + slices.IsSorted(a) // want `golang.org/x/exp/slices\.IsSorted\(\) can be replaced by slices\.IsSorted\(\)` |
| 87 | + slices.IsSortedFunc(a, func(_, _ string) int { // want `golang.org/x/exp/slices\.IsSortedFunc\(\) can be replaced by slices\.IsSortedFunc\(\)` |
| 88 | + return 0 |
| 89 | + }) |
| 90 | + slices.Min(a) // want `golang.org/x/exp/slices\.Min\(\) can be replaced by slices\.Min\(\)` |
| 91 | + slices.MinFunc(a, func(_, _ string) int { // want `golang.org/x/exp/slices\.MinFunc\(\) can be replaced by slices\.MinFunc\(\)` |
| 92 | + return 0 |
| 93 | + }) |
| 94 | + slices.Max(a) // want `golang.org/x/exp/slices\.Max\(\) can be replaced by slices\.Max\(\)` |
| 95 | + slices.MaxFunc(a, func(_, _ string) int { // want `golang.org/x/exp/slices\.MaxFunc\(\) can be replaced by slices\.MaxFunc\(\)` |
| 96 | + return 0 |
| 97 | + }) |
| 98 | + slices.BinarySearch(a, "a") // want `golang.org/x/exp/slices\.BinarySearch\(\) can be replaced by slices\.BinarySearch\(\)` |
| 99 | + slices.BinarySearchFunc(a, b, func(_ string, _ []string) int { // want `golang.org/x/exp/slices\.BinarySearchFunc\(\) can be replaced by slices\.BinarySearchFunc\(\)` |
| 100 | + return 0 |
| 101 | + }) |
| 102 | +} |
0 commit comments