def METHOD_NAME(suffix):
    """
    Check if loading a structure from a file written via
    :func:`save_structure()` gives the same result as the input to
    :func:`save_structure()`.
    """
    path = join(data_dir("structure"), "1l2y.mmtf")
    ref_array = strucio.load_structure(path)
    if suffix in ("trr", "xtc", "tng", "dcd", "netcdf"):
        # Reading a trajectory file requires a template
        template = path
    else:
        template = None
    temp = NamedTemporaryFile("w", suffix=f".{suffix}", delete=False)
    strucio.save_structure(temp.name, ref_array)
    temp.close()
    test_array = strucio.load_structure(temp.name, template)
    os.remove(temp.name)
    for category in ref_array.get_annotation_categories():
        if category == "chain_id" and suffix == "gro":
            # The chain ID is not written to GRO files
            continue
        assert test_array.get_annotation(category).tolist() \
            ==  ref_array.get_annotation(category).tolist()
    assert test_array.coord.flatten().tolist() == pytest.approx(
            ref_array.coord.flatten().tolist(), abs=1e-2
    )