mirror of
https://github.com/turbot/steampipe.git
synced 2026-05-11 00:02:37 -04:00
20 lines
437 B
Go
20 lines
437 B
Go
package db_local
|
|
|
|
import "testing"
|
|
|
|
func TestIsValidDatabaseName(t *testing.T) {
|
|
tests := map[string]bool{
|
|
"valid_name": true,
|
|
"_valid_name": true,
|
|
"InvalidName": false,
|
|
"123Invalid": false,
|
|
}
|
|
|
|
for dbName, expectedResult := range tests {
|
|
if actualResult := isValidDatabaseName(dbName); actualResult != expectedResult {
|
|
t.Logf("Expected %t for %s, but for %t", expectedResult, dbName, actualResult)
|
|
t.Fail()
|
|
}
|
|
}
|
|
}
|