github.com/qiniu/go-sdk/v7@v7.27.0/storage/backward_compatible_test.go (about)

     1  //go:build unit
     2  // +build unit
     3  
     4  package storage
     5  
     6  import (
     7  	"fmt"
     8  	"runtime"
     9  	"testing"
    10  
    11  	"github.com/qiniu/go-sdk/v7/conf"
    12  )
    13  
    14  func TestVariable(t *testing.T) {
    15  	appName := "test"
    16  
    17  	SetAppName(appName)
    18  
    19  	want := fmt.Sprintf("QiniuGo/%s (%s; %s; %s) %s", conf.Version, runtime.GOOS, runtime.GOARCH, appName, runtime.Version())
    20  
    21  	if UserAgent != want {
    22  		t.Fail()
    23  	}
    24  }