MCPcopy
hub / github.com/hashicorp/hcl / TestPartitionTokens

Function TestPartitionTokens

hclwrite/parser_test.go:1231–1373  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1229}
1230
1231func TestPartitionTokens(t *testing.T) {
1232 tests := []struct {
1233 tokens hclsyntax.Tokens
1234 rng hcl.Range
1235 wantStart int
1236 wantEnd int
1237 }{
1238 {
1239 hclsyntax.Tokens{},
1240 hcl.Range{
1241 Start: hcl.Pos{Byte: 0},
1242 End: hcl.Pos{Byte: 0},
1243 },
1244 0,
1245 0,
1246 },
1247 {
1248 hclsyntax.Tokens{
1249 {
1250 Type: hclsyntax.TokenIdent,
1251 Range: hcl.Range{
1252 Start: hcl.Pos{Byte: 0},
1253 End: hcl.Pos{Byte: 4},
1254 },
1255 },
1256 },
1257 hcl.Range{
1258 Start: hcl.Pos{Byte: 0},
1259 End: hcl.Pos{Byte: 4},
1260 },
1261 0,
1262 1,
1263 },
1264 {
1265 hclsyntax.Tokens{
1266 {
1267 Type: hclsyntax.TokenIdent,
1268 Range: hcl.Range{
1269 Start: hcl.Pos{Byte: 0},
1270 End: hcl.Pos{Byte: 4},
1271 },
1272 },
1273 {
1274 Type: hclsyntax.TokenIdent,
1275 Range: hcl.Range{
1276 Start: hcl.Pos{Byte: 4},
1277 End: hcl.Pos{Byte: 8},
1278 },
1279 },
1280 {
1281 Type: hclsyntax.TokenIdent,
1282 Range: hcl.Range{
1283 Start: hcl.Pos{Byte: 8},
1284 End: hcl.Pos{Byte: 12},
1285 },
1286 },
1287 },
1288 hcl.Range{

Callers

nothing calls this directly

Calls 2

partitionTokensFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected