You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: networks_test.go
    path of file: ./repos/trivy/pkg/iac/adapters/terraform/google/compute
    
    the code of the file until where you have to start completion: package compute

import (
	"testing"

	"github.com/aquasecurity/trivy/internal/testutil"
	"github.com/aquasecurity/trivy/pkg/iac/adapters/terraform/tftestutil"
	iacTypes "github.com/aquasecurity/trivy/pkg/iac/types"

	"github.com/aquasecurity/trivy/pkg/iac/providers/google/compute"
)

func Test_adaptNetworks(t *testing.T) {
	tests := []struct {
		name      string
		terraform string
		expected  []compute.Network
	}{
		{
			name: "defined",
			terraform: `
			resource "google_compute_subnetwork" "example" {
				name          = "test-subnetwork"
				network       = google_compute_network.example.id
				log_config {
				  aggregation_interval = "INTERVAL_10_MIN"
				  flow_sampling        = 0.5
				  metadata             = "INCLUDE_ALL_METADATA"
				}
			  }

			  resource "google_compute_network" "example" {
				name                    = "test-network"
				auto_creat
    
func Test_adaptNetworks(t *testing.T) {
	tests := []struct {
		name      string
		terraform string
		expected  []compute.Network
	}{
		{
			name: "defined",
			terraform: `
			resource "google_compute_subnetwork" "example" {
				name          = "test-subnetwork"
				network       = google_compute_network.example.id
				log_config {
				  aggregation_interval = "INTERVAL_10_MIN"
				  flow_sampling        = 0.5
				  metadata             = "INCLUDE_ALL_METADATA"
				}
			  }

			  resource "google_compute_network" "example" {
				name                    = "test-network"
				auto_create_subnetworks = false
			  }

			  resource "google_compute_firewall" "example" {
				name        = "my-firewall-rule"
				network = google_compute_network.example.name
				source_ranges = ["1.2.3.4/32"]
				allow {
				  protocol = "icmp"
				  ports     = ["80", "8080"]
				}
			  }
`,
			expected: []compute.Network{
				{
					Metadata: iacTypes.NewTestMetadata(),
					Firewall: &compute.Firewall{
						Metadata: iacTypes.NewTestMetadata(),
						Name:     iacTypes.String("my-firewall-rule", iacTypes.NewTestMetadata()),
						IngressRules: []compute.IngressRule{
							{
								Metadata: iacTypes.NewTestMetadata(),
								FirewallRule: compute.FirewallRule{
									Metadata: iacTypes.NewTestMetadata(),
									IsAllow:  iacTypes.Bool(true, iacTypes.NewTestMetadata()),
									Protocol: iacTypes.String("icmp", iacTypes.NewTestMetadata()),
									Enforced: iacTypes.Bool(true, iacTypes.NewTestMetadata()),
									Ports: []iacTypes.IntValue{
										iacTypes.Int(80, iacTypes.NewTestMetadata()),
										iacTypes.Int(8080, iacTypes.NewTestMetadata()),
									},
								},
								SourceRanges: []iacTypes.StringValue{
									iacTypes.String("1.2.3.4/32", iacTypes.NewTestMetadata()),
								},
							},
						},
					},
					Subnetworks: []compute.SubNetwork{
						{
							Metadata:       iacTypes.NewTestMetadata(),
							Name:           iacTypes.String("test-subnetwork", iacTypes.NewTestMetadata()),
							EnableFlowLogs: iacTypes.Bool(true, iacTypes.NewTestMetadata()),
							Purpose:        iacTypes.StringDefault("PRIVATE_RFC_1918", iacTypes.NewTestMetadata()),
						},
					},
				},
			},
		},
		{
			name: "defaults",
			terraform: `
			resource "google_compute_subnetwork" "example" {
				network = google_compute_network.example.id
				purpose = "REGIONAL_MANAGED_PROXY"
			  }

			  resource "google_compute_network" "example" {
			  }

			  resource "google_compute_firewall" "example" {
				network = google_compute_network.example.name
			}
`,
			expected: []compute.Network{
				{
					Metadata: iacTypes.NewTestMetadata(),
					Firewall: &compute.Firewall{
						Metadata: iacTypes.NewTestMetadata(),
						Name:     iacTypes.String("", iacTypes.NewTestMetadata()),
					},
					Subnetworks: []compute.SubNetwork{
						{
							Metadata:       iacTypes.NewTestMetadata(),
							Name:           iacTypes.String("", iacTypes.NewTestMetadata()),
							EnableFlowLogs: iacTypes.Bool(false, iacTypes.NewTestMetadata()),
							Purpose:        iacTypes.String("REGIONAL_MANAGED_PROXY", iacTypes.NewTestMetadata()),
						},
					},
				},
			},
		},
	}

	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			modules := tftestutil.CreateModulesFromSource(t, test.terraform, ".tf")
			adapted := adaptNetworks(modules)
			testutil.AssertDefsecEqual(t, test.expected, adapted)
		})
	}
}