yu-iskw commented on code in PR #3174: URL: https://github.com/apache/arrow-adbc/pull/3174#discussion_r2220687668
########## go/adbc/driver/bigquery/driver_test.go: ########## @@ -1551,3 +1551,73 @@ func (suite *BigQueryTests) TestMetadataGetObjectsColumnsXdbc() { } var _ validation.DriverQuirks = (*BigQueryQuirks)(nil) + +// TestDriverConstructorWithNilClientFactory tests that the driver constructor +// handles nil client factory gracefully by using the default factory. +func TestDriverConstructorWithNilClientFactory(t *testing.T) { + mem := memory.NewCheckedAllocator(memory.DefaultAllocator) + defer mem.AssertSize(t, 0) + + // Test that NewDriverWithClientFactory with nil doesn't panic + drv := driver.NewDriverWithClientFactory(mem, nil) + if drv == nil { + t.Error("Driver should not be nil") + } + + // Test that we can create a database with the driver + db, err := drv.NewDatabase(nil) + if err != nil { + t.Errorf("Failed to create database: %v", err) + } + if db == nil { + t.Error("Database should not be nil") + } + defer db.Close() +} + +// TestWithAccessTokenConstant tests that the WithAccessToken constant +// follows the correct BigQuery naming pattern. +func TestWithAccessTokenConstant(t *testing.T) { + expected := "adbc.google.bigquery.auth.access_token" + if driver.WithAccessToken != expected { + t.Errorf("WithAccessToken constant should be %s, got %s", expected, driver.WithAccessToken) + } +} + +// TestAuthTypeConsolidation tests that all auth type values are handled +// correctly in the consolidated switch statement. +func TestAuthTypeConsolidation(t *testing.T) { + mem := memory.NewCheckedAllocator(memory.DefaultAllocator) + defer mem.AssertSize(t, 0) + + drv := driver.NewDriver(mem) + db, err := drv.NewDatabase(nil) + if err != nil { + t.Fatalf("Failed to create database: %v", err) + } + defer db.Close() Review Comment: I have modified that. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org