github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/pkg/db/db_local/install_test.go (about)

     1  package db_local
     2  
     3  import "testing"
     4  
     5  func TestIsValidDatabaseName(t *testing.T) {
     6  	tests := map[string]bool{
     7  		"valid_name":  true,
     8  		"_valid_name": true,
     9  		"InvalidName": false,
    10  		"123Invalid":  false,
    11  	}
    12  
    13  	for dbName, expectedResult := range tests {
    14  		if actualResult := isValidDatabaseName(dbName); actualResult != expectedResult {
    15  			t.Logf("Expected %t for %s, but for %t", expectedResult, dbName, actualResult)
    16  			t.Fail()
    17  		}
    18  	}
    19  }