github.com/octohelm/cuemod@v0.9.4/pkg/cuemod/mod_resolver_test.go (about)

     1  package cuemod
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	"github.com/go-courier/logr/slog"
     8  
     9  	"github.com/octohelm/cuemod/pkg/cuemod/modfile"
    10  
    11  	"github.com/go-courier/logr"
    12  
    13  	. "github.com/onsi/gomega"
    14  
    15  	_ "github.com/octohelm/cuemod/pkg/cuemod/testdata/embedstdlib"
    16  )
    17  
    18  func TestModResolver(t *testing.T) {
    19  	ctx := logr.WithLogger(context.Background(), slog.Logger(slog.Default()))
    20  
    21  	ctx = WithOpts(ctx, OptVerbose(true))
    22  
    23  	m := newModResolver()
    24  
    25  	t.Run("should resolve stdlib", func(t *testing.T) {
    26  		mod, err := m.Get(ctx, "std.x.io/a", modfile.ModVersion{VcsRef: "main"})
    27  		NewWithT(t).Expect(err).To(BeNil())
    28  		NewWithT(t).Expect(mod.Module).To(Equal("std.x.io"))
    29  		NewWithT(t).Expect(mod.Repo).To(Equal("std.x.io"))
    30  	})
    31  }