(t *testing.T)
| 1595 | } |
| 1596 | |
| 1597 | func TestRenameDetectionLengthRatio(t *testing.T) { |
| 1598 | ansi.DisableColors(true) |
| 1599 | |
| 1600 | makeSpec := func(name string, content string) map[string]*manifest.MappingResult { |
| 1601 | return map[string]*manifest.MappingResult{ |
| 1602 | name: { |
| 1603 | Name: name, |
| 1604 | Kind: "Deployment", |
| 1605 | Content: content, |
| 1606 | }, |
| 1607 | } |
| 1608 | } |
| 1609 | |
| 1610 | shortContent := ` |
| 1611 | apiVersion: apps/v1 |
| 1612 | kind: Deployment |
| 1613 | metadata: |
| 1614 | name: short |
| 1615 | spec: |
| 1616 | replicas: 1 |
| 1617 | ` |
| 1618 | |
| 1619 | shortContentRenamed := ` |
| 1620 | apiVersion: apps/v1 |
| 1621 | kind: Deployment |
| 1622 | metadata: |
| 1623 | name: short-renamed |
| 1624 | spec: |
| 1625 | replicas: 1 |
| 1626 | ` |
| 1627 | |
| 1628 | longContent := ` |
| 1629 | apiVersion: apps/v1 |
| 1630 | kind: Deployment |
| 1631 | metadata: |
| 1632 | name: very-long |
| 1633 | spec: |
| 1634 | replicas: 1 |
| 1635 | template: |
| 1636 | spec: |
| 1637 | containers: |
| 1638 | - name: app |
| 1639 | image: myapp:v1 |
| 1640 | ports: |
| 1641 | - containerPort: 8080 |
| 1642 | env: |
| 1643 | - name: VAR1 |
| 1644 | value: "hello" |
| 1645 | - name: VAR2 |
| 1646 | value: "world" |
| 1647 | - name: VAR3 |
| 1648 | value: "foo" |
| 1649 | - name: VAR4 |
| 1650 | value: "bar" |
| 1651 | - name: VAR5 |
| 1652 | value: "baz" |
| 1653 | resources: |
| 1654 | limits: |