repo_description: The AWS Provider enables Terraform to manage AWS resources.
repo_topics: aws terraform terraform-provider
code: // Copyright IBM Corp. 2014, 2026
  // SPDX-License-Identifier: MPL-2.0
  
  package create
  
  import (
  	"testing"
  )
  
  func TestStringHashcode(t *testing.T) {
  	t.Parallel()
  
  	v := "hello, world"
  	expected := StringHashcode(v)
  	for range 100 {
  		actual := StringHashcode(v)
  		if actual != expected {
  			t.Fatalf("bad: %#v\n\t%#v", actual, expected)
  		}
  	}
  }
  
  func TestStringHashcode_positiveIndex(t *testing.T) {
  	t.Parallel()
  
  	// "2338615298" hashes to uint32[REDACTED_PHONE]) which is math.MinInt32
  	ips := []string{"192.168.1.3", "192.168.1.5", "2338615298"}
  	for _, ip := range ips {
  		if index := StringHashcode(ip); index < 0 {
  			t.Fatalf("Bad Index %#v for ip %s", index, ip)
  		}
  	}
  }
  