github.com/go-xe2/third@v1.0.3/golang.org/x/text/internal/testtext/flag.go (about)

     1  // Copyright 2015 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  
     5  package testtext
     6  
     7  import (
     8  	"flag"
     9  	"testing"
    10  
    11  	"github.com/go-xe2/third/golang.org/x/text/internal/gen"
    12  )
    13  
    14  var long = flag.Bool("long", false,
    15  	"run tests that require fetching data online")
    16  
    17  // SkipIfNotLong returns whether long tests should be performed.
    18  func SkipIfNotLong(t *testing.T) {
    19  	if testing.Short() || !(gen.IsLocal() || *long) {
    20  		t.Skip("skipping test to prevent downloading; to run use -long or use -local or UNICODE_DIR to specify a local source")
    21  	}
    22  }