mirror of
https://github.com/prometheus/prometheus
synced 2024-12-29 02:02:17 +00:00
Merge pull request #13885 from bboreham/readable-test
[TESTS] Truncate some long test names, for readability
This commit is contained in:
commit
31491eb37c
@ -100,7 +100,7 @@ func TestFastRegexMatcher_MatchString(t *testing.T) {
|
|||||||
r := r
|
r := r
|
||||||
for _, v := range testValues {
|
for _, v := range testValues {
|
||||||
v := v
|
v := v
|
||||||
t.Run(r+` on "`+v+`"`, func(t *testing.T) {
|
t.Run(readable(r)+` on "`+readable(v)+`"`, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
m, err := NewFastRegexMatcher(r)
|
m, err := NewFastRegexMatcher(r)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@ -111,6 +111,14 @@ func TestFastRegexMatcher_MatchString(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func readable(s string) string {
|
||||||
|
const maxReadableStringLen = 40
|
||||||
|
if len(s) < maxReadableStringLen {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
return s[:maxReadableStringLen] + "..."
|
||||||
|
}
|
||||||
|
|
||||||
func TestOptimizeConcatRegex(t *testing.T) {
|
func TestOptimizeConcatRegex(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
regex string
|
regex string
|
||||||
|
@ -3696,9 +3696,17 @@ func makeInt64Pointer(val int64) *int64 {
|
|||||||
return valp
|
return valp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func readable(s string) string {
|
||||||
|
const maxReadableStringLen = 40
|
||||||
|
if len(s) < maxReadableStringLen {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
return s[:maxReadableStringLen] + "..."
|
||||||
|
}
|
||||||
|
|
||||||
func TestParseExpressions(t *testing.T) {
|
func TestParseExpressions(t *testing.T) {
|
||||||
for _, test := range testExpr {
|
for _, test := range testExpr {
|
||||||
t.Run(test.input, func(t *testing.T) {
|
t.Run(readable(test.input), func(t *testing.T) {
|
||||||
expr, err := ParseExpr(test.input)
|
expr, err := ParseExpr(test.input)
|
||||||
|
|
||||||
// Unexpected errors are always caused by a bug.
|
// Unexpected errors are always caused by a bug.
|
||||||
|
Loading…
Reference in New Issue
Block a user