Download pkg/slicesx/map_test.go from Leon4gr45/openmeter: direct link, hf CLI and curl.
- Browser
- Download file 292 Bytes
-
https://huggingface.co/spaces/Leon4gr45/openmeter/resolve/main/pkg/slicesx/map_test.go
- Command line
-
hf download hf://spaces/Leon4gr45/openmeter/pkg/slicesx/map_test.go
-
curl -L -o map_test.go https://huggingface.co/spaces/Leon4gr45/openmeter/resolve/main/pkg/slicesx/map_test.go
292 Bytes
| package slicesx | |
| import ( | |
| "fmt" | |
| "reflect" | |
| "testing" | |
| ) | |
| func TestMap(t *testing.T) { | |
| s := []int{1, 2, 3} | |
| expected := []string{"1", "2", "3"} | |
| actual := Map(s, func(v int) string { | |
| return fmt.Sprintf("%d", v) | |
| }) | |
| if !reflect.DeepEqual(expected, actual) { | |
| t.Fatal("map failed") | |
| } | |
| } | |