| 1 | package hcl_testscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.25 fmt/" |
| 5 | "testingscip-go gomod github.com/golang/go/src go1.25 testing/" |
| 6 | |
| 7 | "github.com/tomwright/dasel/v3/parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/" |
| 8 | "github.com/tomwright/dasel/v3/parsing/hclscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl`/" |
| 9 | ) |
| 10 | |
| 11 | type readTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase# struct { |
| 12 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#in. string |
| 13 | } |
| 14 | |
| 15 | func (tc readTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#) runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#run().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 16 | r, err := hclscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl`/.HCLscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl`/HCL..NewReaderscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#NewReader().(parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.DefaultReaderOptionsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/DefaultReaderOptions().()) |
| 17 | if err != nil { |
| 18 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %v", err) |
| 19 | } |
| 20 | |
| 21 | in := []byte(tc.inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#in.) |
| 22 | |
| 23 | got, err := r.Readscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Reader#Read.(in) |
| 24 | if err != nil { |
| 25 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("unexpected error: %v", err) |
| 26 | return |
| 27 | } |
| 28 | |
| 29 | fmtscip-go gomod github.com/golang/go/src go1.25 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.25 fmt/Println().(got) |
| 30 | } |
| 31 | |
| 32 | func TestHclReader_Readscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/TestHclReader_Read().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 33 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("document a", readTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#{ |
| 34 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#in.: `io_mode = "async" |
| 35 | |
| 36 | service "http" "web_proxy" { |
| 37 | listen_addr = "127.0.0.1:8080" |
| 38 | |
| 39 | process "main" { |
| 40 | command = ["/usr/local/bin/awesome-app", "server"] |
| 41 | } |
| 42 | |
| 43 | process "mgmt" { |
| 44 | command = ["/usr/local/bin/awesome-app", "mgmt"] |
| 45 | } |
| 46 | }`, |
| 47 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#run().) |
| 48 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("document b", readTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#{ |
| 49 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#in.: `resource "aws_instance" "example" { |
| 50 | # (resource configuration omitted for brevity) |
| 51 | |
| 52 | provisioner "local-exec" { |
| 53 | command = "echo 'Hello World' >example.txt" |
| 54 | } |
| 55 | provisioner "file" { |
| 56 | source = "example.txt" |
| 57 | destination = "/tmp/example.txt" |
| 58 | } |
| 59 | provisioner "remote-exec" { |
| 60 | inline = [ |
| 61 | "sudo install-something -f /tmp/example.txt", |
| 62 | ] |
| 63 | } |
| 64 | }`, |
| 65 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#run().) |
| 66 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("document c", readTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#{ |
| 67 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#in.: `image_id = "ami-123" |
| 68 | cluster_min_nodes = 2 |
| 69 | cluster_decimal_nodes = 2.2 |
| 70 | cluster_max_nodes = true |
| 71 | availability_zone_names = [ |
| 72 | "us-east-1a", |
| 73 | "us-west-1c", |
| 74 | ] |
| 75 | docker_ports = [{ |
| 76 | internal = 8300 |
| 77 | external = 8300 |
| 78 | protocol = "tcp" |
| 79 | }, |
| 80 | { |
| 81 | internal = 8301 |
| 82 | external = 8301 |
| 83 | protocol = "tcp" |
| 84 | } |
| 85 | ]`, |
| 86 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/hcl_test`/readTestCase#run().) |
| 87 | } |