MCPcopy
hub / github.com/databus23/helm-diff / TestRenameDetectionLengthRatio

Function TestRenameDetectionLengthRatio

diff/diff_test.go:1597–1720  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1595}
1596
1597func 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 := `
1611apiVersion: apps/v1
1612kind: Deployment
1613metadata:
1614 name: short
1615spec:
1616 replicas: 1
1617`
1618
1619 shortContentRenamed := `
1620apiVersion: apps/v1
1621kind: Deployment
1622metadata:
1623 name: short-renamed
1624spec:
1625 replicas: 1
1626`
1627
1628 longContent := `
1629apiVersion: apps/v1
1630kind: Deployment
1631metadata:
1632 name: very-long
1633spec:
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:

Callers

nothing calls this directly

Calls 2

ManifestsFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected