MCPcopy
hub / github.com/grafana/tempo / TestIncludeBlock

Function TestIncludeBlock

modules/livestore/instance_search_test.go:1107–1175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1105}
1106
1107func TestIncludeBlock(t *testing.T) {
1108 tests := []struct {
1109 blocKStart int64
1110 blockEnd int64
1111 reqStart uint32
1112 reqEnd uint32
1113 expected bool
1114 }{
1115 // if request is 0s, block start/end don't matter
1116 {
1117 blocKStart: 100,
1118 blockEnd: 200,
1119 reqStart: 0,
1120 reqEnd: 0,
1121 expected: true,
1122 },
1123 // req before
1124 {
1125 blocKStart: 100,
1126 blockEnd: 200,
1127 reqStart: 50,
1128 reqEnd: 99,
1129 expected: false,
1130 },
1131 // overlap front
1132 {
1133 blocKStart: 100,
1134 blockEnd: 200,
1135 reqStart: 50,
1136 reqEnd: 150,
1137 expected: true,
1138 },
1139 // inside block
1140 {
1141 blocKStart: 100,
1142 blockEnd: 200,
1143 reqStart: 110,
1144 reqEnd: 150,
1145 expected: true,
1146 },
1147 // overlap end
1148 {
1149 blocKStart: 100,
1150 blockEnd: 200,
1151 reqStart: 150,
1152 reqEnd: 250,
1153 expected: true,
1154 },
1155 // after block
1156 {
1157 blocKStart: 100,
1158 blockEnd: 200,
1159 reqStart: 201,
1160 reqEnd: 250,
1161 expected: false,
1162 },
1163 }
1164

Callers

nothing calls this directly

Calls 3

includeBlockFunction · 0.70
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected