(t *testing.T)
| 1680 | } |
| 1681 | |
| 1682 | func TestTransform(t *testing.T) { |
| 1683 | source := []any{ |
| 1684 | "80-82:8080-8082", |
| 1685 | "90-92:8090-8092/udp", |
| 1686 | "85:8500", |
| 1687 | 8600, |
| 1688 | map[string]any{ |
| 1689 | "protocol": "udp", |
| 1690 | "target": 53, |
| 1691 | "published": 10053, |
| 1692 | }, |
| 1693 | map[string]any{ |
| 1694 | "mode": "host", |
| 1695 | "target": 22, |
| 1696 | "published": 10022, |
| 1697 | }, |
| 1698 | } |
| 1699 | var ports []types.ServicePortConfig |
| 1700 | err := Transform(source, &ports) |
| 1701 | assert.NilError(t, err) |
| 1702 | |
| 1703 | assert.Check(t, is.DeepEqual(samplePortsConfig, ports)) |
| 1704 | } |
| 1705 | |
| 1706 | func TestLoadTemplateDriver(t *testing.T) { |
| 1707 | config, err := loadYAML(` |
nothing calls this directly
no test coverage detected
searching dependent graphs…