Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

29 řádky
705 B

  1. // Copyright 2017 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package gensupport
  5. import (
  6. "fmt"
  7. "runtime"
  8. "strings"
  9. "testing"
  10. )
  11. func TestGoogleClientHeader(t *testing.T) {
  12. const genVersion = "20170101"
  13. gv := strings.Replace(runtime.Version(), " ", "_", -1)
  14. got := GoogleClientHeader(genVersion, "gccl/xyz")
  15. want := fmt.Sprintf("gl-go/%s gccl/xyz gdcl/%s", gv, genVersion)
  16. if got != want {
  17. t.Errorf("got %q, want %q", got, want)
  18. }
  19. got = GoogleClientHeader(genVersion, "")
  20. want = fmt.Sprintf("gl-go/%s gdcl/%s", gv, genVersion)
  21. if got != want {
  22. t.Errorf("got %q, want %q", got, want)
  23. }
  24. }