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

AsaiYusuke / jsonpath / 16410926563

21 Jul 2025 07:14AM UTC coverage: 17.851% (-79.5%) from 97.363%
16410926563

Pull #46

github

AsaiYusuke
refactor: move syntax and tests to internal directory

Separate directory structure from public API by relocating syntax
and test files under internal/ directory structure.
Pull Request #46: Move syntax to the internal directory and reorganize tests

181 of 406 new or added lines in 17 files covered. (44.58%)

3 existing lines in 1 file now uncovered.

676 of 3787 relevant lines covered (17.85%)

17.95 hits per line

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

0.0
/internal/syntax/syntax_node_identifier_child_multi.go
1
package syntax
2

3
import "reflect"
4

5
type syntaxChildMultiIdentifier struct {
6
        *syntaxBasicNode
7

8
        identifiers    []syntaxNode
9
        isAllWildcard  bool
10
        unionQualifier syntaxUnionQualifier
11
}
12

13
func (i *syntaxChildMultiIdentifier) retrieve(
14
        root, current interface{}, container *bufferContainer) errorRuntime {
×
15

×
16
        if i.isAllWildcard {
×
17
                if _, ok := current.([]interface{}); ok {
×
18
                        // If the "current" variable points to the array structure
×
19
                        // and only wildcards are specified for qualifier,
×
20
                        // then switch to syntaxUnionQualifier.
×
21
                        return i.unionQualifier.retrieve(root, current, container)
×
22
                }
×
23
        }
24

25
        if srcMap, ok := current.(map[string]interface{}); ok {
×
26
                return i.retrieveMap(root, srcMap, container)
×
27
        }
×
28

29
        foundType := msgTypeNull
×
30
        if current != nil {
×
31
                foundType = reflect.TypeOf(current).String()
×
32
        }
×
NEW
33
        return newErrorTypeUnmatched(i.errorRuntime.node, msgTypeObject, foundType)
×
34
}
35

36
func (i *syntaxChildMultiIdentifier) retrieveMap(
37
        root interface{}, srcMap map[string]interface{}, container *bufferContainer) errorRuntime {
×
38

×
39
        var deepestTextLen int
×
40
        var deepestError errorRuntime
×
41

×
42
        for _, identifier := range i.identifiers {
×
43
                if singleIdentifier, ok := identifier.(*syntaxChildSingleIdentifier); ok {
×
44
                        if _, ok = srcMap[singleIdentifier.identifier]; !ok {
×
45
                                continue
×
46
                        }
47
                }
48

49
                if err := identifier.retrieve(root, srcMap, container); err != nil {
×
50
                        if len(container.result) == 0 {
×
51
                                deepestTextLen, deepestError = i.addDeepestError(err, deepestTextLen, deepestError)
×
52
                        }
×
53
                }
54
        }
55

56
        if len(container.result) > 0 {
×
57
                return nil
×
58
        }
×
59

60
        if deepestError == nil {
×
NEW
61
                return newErrorMemberNotExist(i.errorRuntime.node)
×
62
        }
×
63

64
        return deepestError
×
65
}
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

© 2026 Coveralls, Inc