github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/golang/text/secure/precis/benchmark_test.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 precis
     6  
     7  import (
     8  	"testing"
     9  )
    10  
    11  func BenchmarkUsernameCaseMapped(b *testing.B) {
    12  	for i := 0; i < b.N; i++ {
    13  		UsernameCaseMapped.String("Malvolio")
    14  	}
    15  }
    16  
    17  func BenchmarkUsernameCasePreserved(b *testing.B) {
    18  	for i := 0; i < b.N; i++ {
    19  		UsernameCasePreserved.String("Malvolio")
    20  	}
    21  }
    22  
    23  func BenchmarkOpaqueString(b *testing.B) {
    24  	for i := 0; i < b.N; i++ {
    25  		OpaqueString.String("Malvolio")
    26  	}
    27  }
    28  
    29  func BenchmarkNickname(b *testing.B) {
    30  	for i := 0; i < b.N; i++ {
    31  		Nickname.String("Malvolio")
    32  	}
    33  }