distribution/internal/dcontext/version_test.go
Milos Gajdos a940e61623
Fix silly testing format mistakes
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2024-08-30 11:18:18 +01:00

20 lines
366 B
Go

package dcontext
import "testing"
func TestVersionContext(t *testing.T) {
ctx := Background()
if GetVersion(ctx) != "" {
t.Fatal("context should not yet have a version")
}
expected := "2.1-whatever"
ctx = WithVersion(ctx, expected)
version := GetVersion(ctx)
if version != expected {
t.Fatalf("version was not set: %q != %q", version, expected)
}
}