(t *testing.T)
| 346 | } |
| 347 | |
| 348 | func TestBodySetAttributeValue(t *testing.T) { |
| 349 | tests := []struct { |
| 350 | src string |
| 351 | name string |
| 352 | val cty.Value |
| 353 | want Tokens |
| 354 | }{ |
| 355 | { |
| 356 | "", |
| 357 | "a", |
| 358 | cty.True, |
| 359 | Tokens{ |
| 360 | { |
| 361 | Type: hclsyntax.TokenIdent, |
| 362 | Bytes: []byte{'a'}, |
| 363 | SpacesBefore: 0, |
| 364 | }, |
| 365 | { |
| 366 | Type: hclsyntax.TokenEqual, |
| 367 | Bytes: []byte{'='}, |
| 368 | SpacesBefore: 1, |
| 369 | }, |
| 370 | { |
| 371 | Type: hclsyntax.TokenIdent, |
| 372 | Bytes: []byte("true"), |
| 373 | SpacesBefore: 1, |
| 374 | }, |
| 375 | { |
| 376 | Type: hclsyntax.TokenNewline, |
| 377 | Bytes: []byte{'\n'}, |
| 378 | SpacesBefore: 0, |
| 379 | }, |
| 380 | { |
| 381 | Type: hclsyntax.TokenEOF, |
| 382 | Bytes: []byte{}, |
| 383 | SpacesBefore: 0, |
| 384 | }, |
| 385 | }, |
| 386 | }, |
| 387 | { |
| 388 | "b = false\n", |
| 389 | "a", |
| 390 | cty.True, |
| 391 | Tokens{ |
| 392 | { |
| 393 | Type: hclsyntax.TokenIdent, |
| 394 | Bytes: []byte{'b'}, |
| 395 | SpacesBefore: 0, |
| 396 | }, |
| 397 | { |
| 398 | Type: hclsyntax.TokenEqual, |
| 399 | Bytes: []byte{'='}, |
| 400 | SpacesBefore: 1, |
| 401 | }, |
| 402 | { |
| 403 | Type: hclsyntax.TokenIdent, |
| 404 | Bytes: []byte("false"), |
| 405 | SpacesBefore: 1, |
nothing calls this directly
no test coverage detected