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

mlange-42 / modo / 13147139977

04 Feb 2025 11:56PM CUT coverage: 72.623%. Remained the same
13147139977

Pull #200

github

web-flow
Merge 9a034f337 into 15b8f6df4
Pull Request #200: Omit test function for pure global doc-tests

1650 of 2272 relevant lines covered (72.62%)

26.84 hits per line

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

61.73
/document/rename.go
1
package document
2

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

7
func (proc *Processor) renamePackage(p *Package, ownPath string) {
5✔
8
        for i := range p.Packages {
7✔
9
                newPath := ownPath + "." + p.Packages[i].Name
2✔
10
                proc.renamePackage(p.Packages[i], newPath)
2✔
11
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
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 {
10✔
19
                newPath := ownPath + "." + p.Modules[i].Name
5✔
20
                proc.renameModule(p.Modules[i], newPath)
5✔
21
                if newName, ok := proc.renameExports[newPath]; ok {
7✔
22
                        tempMod := *p.Modules[i]
2✔
23
                        tempMod.MemberName = MemberName{Name: newName}
2✔
24
                        p.Modules[i] = &tempMod
2✔
25
                }
2✔
26
        }
27

28
        for i := range p.Aliases {
9✔
29
                newPath := ownPath + "." + p.Aliases[i].Name
4✔
30
                if newName, ok := proc.renameExports[newPath]; ok {
8✔
31
                        tempMod := *p.Aliases[i]
4✔
32
                        tempMod.MemberName = MemberName{Name: newName}
4✔
33
                        p.Aliases[i] = &tempMod
4✔
34
                }
4✔
35
        }
36
        for i := range p.Structs {
8✔
37
                newPath := ownPath + "." + p.Structs[i].Name
3✔
38
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
39
                        //proc.renameStruct(p.Structs[i], newPath, newName)
2✔
40
                        tempMod := *p.Structs[i]
2✔
41
                        tempMod.MemberName = MemberName{Name: newName}
2✔
42
                        p.Structs[i] = &tempMod
2✔
43
                }
2✔
44
        }
45
        for i := range p.Traits {
7✔
46
                newPath := ownPath + "." + p.Traits[i].Name
2✔
47
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
48
                        //proc.renameTrait(p.Traits[i], newPath, newName)
×
49
                        tempMod := *p.Traits[i]
×
50
                        tempMod.MemberName = MemberName{Name: newName}
×
51
                        p.Traits[i] = &tempMod
×
52
                }
×
53
        }
54
        for i := range p.Functions {
7✔
55
                newPath := ownPath + "." + p.Functions[i].Name
2✔
56
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
57
                        tempMod := *p.Functions[i]
×
58
                        tempMod.MemberName = MemberName{Name: newName}
×
59
                        p.Functions[i] = &tempMod
×
60
                }
×
61
        }
62
}
63

64
func (proc *Processor) renameModule(m *Module, ownPath string) {
5✔
65
        for i := range m.Aliases {
10✔
66
                newPath := ownPath + "." + m.Aliases[i].Name
5✔
67
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
68
                        //proc.renameStruct(m.Structs[i], newPath, newName)
×
69
                        tempMod := *m.Aliases[i]
×
70
                        tempMod.MemberName = MemberName{Name: newName}
×
71
                        m.Aliases[i] = &tempMod
×
72
                }
×
73
        }
74
        for i := range m.Structs {
10✔
75
                newPath := ownPath + "." + m.Structs[i].Name
5✔
76
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
77
                        //proc.renameTrait(m.Traits[i], newPath, newName)
×
78
                        tempMod := *m.Structs[i]
×
79
                        tempMod.MemberName = MemberName{Name: newName}
×
80
                        m.Structs[i] = &tempMod
×
81
                }
×
82
        }
83
        for i := range m.Traits {
6✔
84
                newPath := ownPath + "." + m.Traits[i].Name
1✔
85
                if newName, ok := proc.renameExports[newPath]; ok {
1✔
86
                        tempMod := *m.Traits[i]
×
87
                        tempMod.MemberName = MemberName{Name: newName}
×
88
                        m.Traits[i] = &tempMod
×
89
                }
×
90
        }
91
        for i := range m.Functions {
6✔
92
                newPath := ownPath + "." + m.Functions[i].Name
1✔
93
                if newName, ok := proc.renameExports[newPath]; ok {
1✔
94
                        tempMod := *m.Functions[i]
×
95
                        tempMod.MemberName = MemberName{Name: newName}
×
96
                        m.Functions[i] = &tempMod
×
97
                }
×
98
        }
99
}
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