Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/dbc/manifest_list.go → cmd/dbc/driver_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ func GetDriverList(fname string) ([]dbc.PkgInfo, error) {
var m DriversList
f, err := os.Open(fname)
if err != nil {
return nil, fmt.Errorf("error opening manifest file %s: %w", fname, err)
return nil, fmt.Errorf("error opening driver list %s: %w", fname, err)
}
defer f.Close()
if err = toml.NewDecoder(f).Decode(&m); err != nil {
return nil, fmt.Errorf("error decoding manifest file %s: %w", fname, err)
return nil, fmt.Errorf("error decoding driver list %s: %w", fname, err)
}

drivers, err := dbc.GetDriverList()
Expand Down
10 changes: 5 additions & 5 deletions cmd/dbc/manifest_list_test.go → cmd/dbc/driver_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestUnmarshalManifestList(t *testing.T) {
func TestUnmarshalDriverList(t *testing.T) {
tests := []struct {
name string
contents string
Expand All @@ -37,10 +37,10 @@ func TestUnmarshalManifestList(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tmpdir := t.TempDir()
manifestPath := filepath.Join(tmpdir, "manifest.txt")
require.NoError(t, os.WriteFile(manifestPath, []byte(tt.contents), 0644))
driverListPath := filepath.Join(tmpdir, "dbc.toml")
require.NoError(t, os.WriteFile(driverListPath, []byte(tt.contents), 0644))

pkgs, err := GetDriverList(manifestPath)
pkgs, err := GetDriverList(driverListPath)
if tt.err != nil {
require.Error(t, err)
assert.ErrorContains(t, err, tt.err.Error())
Expand Down Expand Up @@ -72,7 +72,7 @@ func must[T any](v T, err error) T {
return v
}

func TestMarshalManifestList(t *testing.T) {
func TestMarshalDriverManifestList(t *testing.T) {
data, err := toml.Marshal(DriversList{
Drivers: map[string]driverSpec{
"flightsql": {Version: must(semver.NewConstraint(">=1.6.0"))},
Expand Down
Loading