github.com/akaros/go-akaros@v0.0.0-20181004170632-85005d477eab/src/cmd/internal/rsc.io/x86/x86asm/inst_test.go (about)

     1  // Copyright 2014 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 x86asm
     6  
     7  import (
     8  	"strings"
     9  	"testing"
    10  )
    11  
    12  func TestRegString(t *testing.T) {
    13  	for r := Reg(1); r <= regMax; r++ {
    14  		if regNames[r] == "" {
    15  			t.Errorf("regNames[%d] is missing", int(r))
    16  		} else if s := r.String(); strings.Contains(s, "Reg(") {
    17  			t.Errorf("Reg(%d).String() = %s, want proper name", int(r), s)
    18  		}
    19  	}
    20  }