1 Debian patch touch this file
| 1 | package sprig |
| 2 | |
| 3 | import ( |
| 4 | "net" |
| 5 | "testing" |
| 6 | |
| 7 | "github.com/stretchr/testify/assert" |
| 8 | ) |
| 9 | |
| 10 | func TestGetHostByName(t *testing.T) { |
| 11 | tpl := `{{"www.google.com" | getHostByName}}` |
| 12 | |
| 13 | resolvedIP, _ := runRaw(tpl, nil) |
| 14 | |
| 15 | ip := net.ParseIP(resolvedIP) |
| 16 | assert.NotNil(t, ip) |
| 17 | assert.NotEmpty(t, ip) |
| 18 | } |