def test_print_ref__strip_surrounding_whitespace():
    ref = TypeRef("lang")
    ref.name = "MyType"
    ref.id = "lang-mytype"
    ref.prefix = "\tconst "
    ref.suffix = " &  "
    assert print_ref(ref) == "const MyType &"
def test_print_ref__name_prefix_suffix_no_id():
    ref = TypeRef("lang")
    ref.name = "MyType"
    ref.id = "lang-mytype"
    ref.prefix = "const "
    ref.suffix = " &"
    assert print_ref(ref) == "const MyType &"
def test_print_ref__nested_types():
    nested_type_with_id = TypeRef("lang")
    nested_type_with_id.name = "Nested1"
    nested_type_with_id.id = "lang-nested1"

    nested_type_without_id = TypeRef("lang")
    nested_type_without_id.name = "Nested2"

    ref = TypeRef("lang")
    ref.name = "MyType"
    ref.prefix = "const "
    ref.suffix = " &"
    ref.id = "lang-tomtom_1_MyType"
    ref.nested = [nested_type_with_id, nested_type_without_id]

    assert print_ref(ref) == "const MyType<Nested1, Nested2> &"
def test_print_ref__name_only():
    ref = TypeRef("lang")
    ref.name = "MyType"
    ref.id = "lang-mytype"
    assert print_ref(ref) == "MyType"
def test_print_ref__none():
    assert print_ref(None) == ""
def test_print_ref__empty():
    ref = TypeRef("lang")
    assert print_ref(ref) == ""