• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlange-42 / modo / 13184884958

06 Feb 2025 05:54PM CUT coverage: 74.117%. Remained the same
13184884958

push

github

web-flow
Add guide section on Modo's doc-testing vs. `mojo test` (#215)

2351 of 3172 relevant lines covered (74.12%)

48.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

63.64
/internal/document/rename.go
1
package document
2

3
func (proc *Processor) renameAll(p *Package) {
6✔
4
        proc.renamePackage(p, p.Name)
6✔
5
}
6✔
6

7
func (proc *Processor) renamePackage(p *Package, ownPath string) {
11✔
8
        for i := range p.Packages {
16✔
9
                newPath := ownPath + "." + p.Packages[i].Name
5✔
10
                proc.renamePackage(p.Packages[i], newPath)
5✔
11
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
12
                        tempPkg := *p.Packages[i]
×
13
                        tempPkg.MemberName = MemberName{Name: newName}
×
14
                        p.Packages[i] = &tempPkg
×
15
                }
×
16
        }
17

18
        for i := range p.Modules {
22✔
19
                newPath := ownPath + "." + p.Modules[i].Name
11✔
20
                proc.renameModule(p.Modules[i], newPath)
11✔
21
                if newName, ok := proc.renameExports[newPath]; ok {
16✔
22
                        tempMod := *p.Modules[i]
5✔
23
                        tempMod.MemberName = MemberName{Name: newName}
5✔
24
                        p.Modules[i] = &tempMod
5✔
25
                }
5✔
26
        }
27

28
        for i := range p.Aliases {
21✔
29
                newPath := ownPath + "." + p.Aliases[i].Name
10✔
30
                if newName, ok := proc.renameExports[newPath]; ok {
20✔
31
                        tempMod := *p.Aliases[i]
10✔
32
                        tempMod.MemberName = MemberName{Name: newName}
10✔
33
                        p.Aliases[i] = &tempMod
10✔
34
                }
10✔
35
        }
36
        for i := range p.Structs {
17✔
37
                newPath := ownPath + "." + p.Structs[i].Name
6✔
38
                if newName, ok := proc.renameExports[newPath]; ok {
11✔
39
                        tempMod := *p.Structs[i]
5✔
40
                        tempMod.MemberName = MemberName{Name: newName}
5✔
41
                        p.Structs[i] = &tempMod
5✔
42
                }
5✔
43
        }
44
        for i := range p.Traits {
16✔
45
                newPath := ownPath + "." + p.Traits[i].Name
5✔
46
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
47
                        tempMod := *p.Traits[i]
×
48
                        tempMod.MemberName = MemberName{Name: newName}
×
49
                        p.Traits[i] = &tempMod
×
50
                }
×
51
        }
52
        for i := range p.Functions {
16✔
53
                newPath := ownPath + "." + p.Functions[i].Name
5✔
54
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
55
                        tempMod := *p.Functions[i]
×
56
                        tempMod.MemberName = MemberName{Name: newName}
×
57
                        p.Functions[i] = &tempMod
×
58
                }
×
59
        }
60
}
61

62
func (proc *Processor) renameModule(m *Module, ownPath string) {
11✔
63
        for i := range m.Aliases {
22✔
64
                newPath := ownPath + "." + m.Aliases[i].Name
11✔
65
                if newName, ok := proc.renameExports[newPath]; ok {
11✔
66
                        tempMod := *m.Aliases[i]
×
67
                        tempMod.MemberName = MemberName{Name: newName}
×
68
                        m.Aliases[i] = &tempMod
×
69
                }
×
70
        }
71
        for i := range m.Structs {
22✔
72
                newPath := ownPath + "." + m.Structs[i].Name
11✔
73
                if newName, ok := proc.renameExports[newPath]; ok {
11✔
74
                        tempMod := *m.Structs[i]
×
75
                        tempMod.MemberName = MemberName{Name: newName}
×
76
                        m.Structs[i] = &tempMod
×
77
                }
×
78
        }
79
        for i := range m.Traits {
12✔
80
                newPath := ownPath + "." + m.Traits[i].Name
1✔
81
                if newName, ok := proc.renameExports[newPath]; ok {
1✔
82
                        tempMod := *m.Traits[i]
×
83
                        tempMod.MemberName = MemberName{Name: newName}
×
84
                        m.Traits[i] = &tempMod
×
85
                }
×
86
        }
87
        for i := range m.Functions {
12✔
88
                newPath := ownPath + "." + m.Functions[i].Name
1✔
89
                if newName, ok := proc.renameExports[newPath]; ok {
1✔
90
                        tempMod := *m.Functions[i]
×
91
                        tempMod.MemberName = MemberName{Name: newName}
×
92
                        m.Functions[i] = &tempMod
×
93
                }
×
94
        }
95
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc