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

Function TestScanTokens_normal

hclsyntax/scan_tokens_test.go:13–2662  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestScanTokens_normal(t *testing.T) {
14 tests := []struct {
15 input string
16 want []Token
17 }{
18 // Empty input
19 {
20 ``,
21 []Token{
22 {
23 Type: TokenEOF,
24 Bytes: []byte{},
25 Range: hcl.Range{
26 Start: hcl.Pos{Byte: 0, Line: 1, Column: 1},
27 End: hcl.Pos{Byte: 0, Line: 1, Column: 1},
28 },
29 },
30 },
31 },
32 {
33 ` `,
34 []Token{
35 {
36 Type: TokenEOF,
37 Bytes: []byte{},
38 Range: hcl.Range{
39 Start: hcl.Pos{Byte: 1, Line: 1, Column: 2},
40 End: hcl.Pos{Byte: 1, Line: 1, Column: 2},
41 },
42 },
43 },
44 },
45 {
46 "\n\n",
47 []Token{
48 {
49 Type: TokenNewline,
50 Bytes: []byte("\n"),
51 Range: hcl.Range{
52 Start: hcl.Pos{Byte: 0, Line: 1, Column: 1},
53 End: hcl.Pos{Byte: 1, Line: 2, Column: 1},
54 },
55 },
56 {
57 Type: TokenNewline,
58 Bytes: []byte("\n"),
59 Range: hcl.Range{
60 Start: hcl.Pos{Byte: 1, Line: 2, Column: 1},
61 End: hcl.Pos{Byte: 2, Line: 3, Column: 1},
62 },
63 },
64 {
65 Type: TokenEOF,
66 Bytes: []byte{},
67 Range: hcl.Range{
68 Start: hcl.Pos{Byte: 2, Line: 3, Column: 1},
69 End: hcl.Pos{Byte: 2, Line: 3, Column: 1},
70 },

Callers

nothing calls this directly

Calls 2

scanTokensFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected