You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/internal/communicator/shared/shared_test.go

30 lines
612 B

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package shared
import (
"testing"
)
func TestIpFormatting_Ipv4(t *testing.T) {
formatted := IpFormat("127.0.0.1")
if formatted != "127.0.0.1" {
t.Fatal("expected", "127.0.0.1", "got", formatted)
}
}
func TestIpFormatting_Hostname(t *testing.T) {
formatted := IpFormat("example.com")
if formatted != "example.com" {
t.Fatal("expected", "example.com", "got", formatted)
}
}
func TestIpFormatting_Ipv6(t *testing.T) {
formatted := IpFormat("::1")
if formatted != "[::1]" {
t.Fatal("expected", "[::1]", "got", formatted)
}
}