Skip to content

Commit c341fe0

Browse files
committed
tests: add output to a version parse error
Now it is difficult to determine what a reason of a `tarantool --version` parsing error. The patch adds a command output to the error to make it easier.
1 parent 8cf8673 commit c341fe0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test_helpers/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,19 @@ func IsTarantoolVersionLess(majorMin uint64, minorMin uint64, patchMin uint64) (
142142
parsed := tarantoolVersionRegexp.FindStringSubmatch(string(out))
143143

144144
if parsed == nil {
145-
return true, errors.New("regexp parse failed")
145+
return true, fmt.Errorf("failed to parse output %q", out)
146146
}
147147

148148
if major, err = atoiUint64(parsed[1]); err != nil {
149-
return true, fmt.Errorf("failed to parse major: %s", err)
149+
return true, fmt.Errorf("failed to parse major from output %q: %w", out, err)
150150
}
151151

152152
if minor, err = atoiUint64(parsed[2]); err != nil {
153-
return true, fmt.Errorf("failed to parse minor: %s", err)
153+
return true, fmt.Errorf("failed to parse minor from output %q: %w", out, err)
154154
}
155155

156156
if patch, err = atoiUint64(parsed[3]); err != nil {
157-
return true, fmt.Errorf("failed to parse patch: %s", err)
157+
return true, fmt.Errorf("failed to parse patch from output %q: %w", out, err)
158158
}
159159

160160
if major != majorMin {

0 commit comments

Comments
 (0)