File: inst_test.go

package info (click to toggle)
golang-golang-x-arch 0.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,932 kB
  • sloc: ansic: 1,975; makefile: 59
file content (20 lines) | stat: -rw-r--r-- 489 bytes parent folder | download | duplicates (30)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2014 The Go Authors.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package x86asm

import (
	"strings"
	"testing"
)

func TestRegString(t *testing.T) {
	for r := Reg(1); r <= regMax; r++ {
		if regNames[r] == "" {
			t.Errorf("regNames[%d] is missing", int(r))
		} else if s := r.String(); strings.Contains(s, "Reg(") {
			t.Errorf("Reg(%d).String() = %s, want proper name", int(r), s)
		}
	}
}