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

jlaffaye / ftp / 8113579643

01 Mar 2024 03:23PM UTC coverage: 72.431%. Remained the same
8113579643

Pull #365

github

web-flow
Bump github.com/stretchr/testify from 1.8.4 to 1.9.0

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #365: Bump github.com/stretchr/testify from 1.8.4 to 1.9.0

712 of 983 relevant lines covered (72.43%)

18.56 hits per line

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

100.0
/scanner.go
1
package ftp
2

3
// A scanner for fields delimited by one or more whitespace characters
4
type scanner struct {
5
        bytes    []byte
6
        position int
7
}
8

9
// newScanner creates a new scanner
10
func newScanner(str string) *scanner {
31✔
11
        return &scanner{
31✔
12
                bytes: []byte(str),
31✔
13
        }
31✔
14
}
31✔
15

16
// NextFields returns the next `count` fields
17
func (s *scanner) NextFields(count int) []string {
49✔
18
        fields := make([]string, 0, count)
49✔
19
        for i := 0; i < count; i++ {
249✔
20
                if field := s.Next(); field != "" {
396✔
21
                        fields = append(fields, field)
196✔
22
                } else {
200✔
23
                        break
4✔
24
                }
25
        }
26
        return fields
49✔
27
}
28

29
// Next returns the next field
30
func (s *scanner) Next() string {
209✔
31
        sLen := len(s.bytes)
209✔
32

209✔
33
        // skip trailing whitespace
209✔
34
        for s.position < sLen {
832✔
35
                if s.bytes[s.position] != ' ' {
825✔
36
                        break
202✔
37
                }
38
                s.position++
421✔
39
        }
40

41
        start := s.position
209✔
42

209✔
43
        // skip non-whitespace
209✔
44
        for s.position < sLen {
1,326✔
45
                if s.bytes[s.position] == ' ' {
1,316✔
46
                        s.position++
199✔
47
                        return string(s.bytes[start : s.position-1])
199✔
48
                }
199✔
49
                s.position++
918✔
50
        }
51

52
        return string(s.bytes[start:s.position])
10✔
53
}
54

55
// Remaining returns the remaining string
56
func (s *scanner) Remaining() string {
30✔
57
        return string(s.bytes[s.position:len(s.bytes)])
30✔
58
}
30✔
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