(t *testing.T)
| 728 | } |
| 729 | db, err := openBaseDB(cfg, "") |
| 730 | if err != nil { |
| 731 | t.Fatalf("openBaseDB failed: %v", err) |
| 732 | } |
| 733 | defer func() { _ = db.Close() }() |
| 734 | |
| 735 | var dbName string |
| 736 | err = db.QueryRow("SELECT current_database()").Scan(&dbName) |
| 737 | if err != nil { |
| 738 | t.Fatalf("failed to query current_database(): %v", err) |
| 739 | } |
| 740 | if dbName != "memory" { |
| 741 | t.Fatalf("expected fallback to in-memory when username is empty, got %q", dbName) |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | func TestHasCacheHTTPFS(t *testing.T) { |
| 746 | tests := []struct { |
| 747 | name string |
| 748 | extensions []string |
| 749 | want bool |
| 750 | }{ |
| 751 | {"present bare", []string{"ducklake", "cache_httpfs"}, true}, |
| 752 | {"present with source", []string{"ducklake", "cache_httpfs FROM community"}, true}, |
| 753 | {"absent", []string{"ducklake", "httpfs"}, false}, |
| 754 | {"empty list", []string{}, false}, |
nothing calls this directly
no test coverage detected