1 //===- string_test.go - test Stringer implementation for Type -------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file tests the Stringer interface for the Type type.
11 //===----------------------------------------------------------------------===//
19 func TestStringRecursiveType(t
*testing
.T
) {
22 s
:= ctx
.StructCreateNamed("recursive")
23 s
.StructSetBody([]Type
{s
, s
}, false)
24 if str
:= s
.String(); str
!= "%recursive: StructType(%recursive, %recursive)" {
25 t
.Errorf("incorrect string result %q", str
)