# why is the igraph\_write\_graph\_lgl example commented out?

**URL:** <https://igraph.discourse.group/t/why-is-the-igraph-write-graph-lgl-example-commented-out/586>\
**Category:** Development\
**Tags:** C\
**Created:** [12 January 2021 10:41 UTC](https://igraph.discourse.group/t/why-is-the-igraph-write-graph-lgl-example-commented-out/586 "2021-01-12T10:41:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GroteGnoom](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/grotegnoom/32/428_2.png) [@GroteGnoom](https://igraph.discourse.group/u/GroteGnoom)\
**Post date:** [12 January 2021 10:41 UTC](https://igraph.discourse.group/t/why-is-the-igraph-write-graph-lgl-example-commented-out/586/1 "2021-01-12T10:41:26Z")

</div>

I was looking into writing a test for igraph\_write\_graph\_lgl, and an example test already exists, but the body is commented out:

> <https://github.com/igraph/igraph/blob/fc15b8b4da892faf92bed12fa88d44c1f491e96d/examples/simple/igraph_write_graph_lgl.c>

Most of the removal was here:

> <https://github.com/igraph/igraph/commit/9e022febd3124cdc9bc970a41d6de8fa3638f8f5#diff-da733c0c0ff3e6dbc1fb250534288d223d7bf47e54ff85dd864b1a9d111a9390>

It says it’s because “we don’t have attributes”, but I’m not sure if that means it can now be completely replaced or should not be tested at all.  
Should I remove it and start anew?

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [12 January 2021 12:43 UTC](https://igraph.discourse.group/t/why-is-the-igraph-write-graph-lgl-example-commented-out/586/2 "2021-01-12T12:43:00Z")

</div>

I don’t know about the reason for commenting this, perhaps @Gabor remembers?

At any rate, the functionality should be tested, so I think you can simply uncomment it and give it a go.

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [12 January 2021 13:25 UTC](https://igraph.discourse.group/t/why-is-the-igraph-write-graph-lgl-example-commented-out/586/3 "2021-01-12T13:25:22Z")

</div>

This is the commit that commented it out: [attributes rewritten, R interface semi-broken, python interface broken · igraph/igraph@9e022fe · GitHub](https://github.com/igraph/igraph/commit/9e022febd3124cdc9bc970a41d6de8fa3638f8f5#diff-da733c0c0ff3e6dbc1fb250534288d223d7bf47e54ff85dd864b1a9d111a9390)

There is also a note about attributes: `/* This is not used right now, as we don't have attributes */`

@tamas Any idea about this?

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [12 January 2021 16:27 UTC](https://igraph.discourse.group/t/why-is-the-igraph-write-graph-lgl-example-commented-out/586/4 "2021-01-12T16:27:46Z")

</div>

It was 14 years ago so I don’t know much, but I think that the test case was commented out because we only tested `igraph_write_graph_lgl()` with vertex (name) and edge (weight) attributes, and Gábor broke something (intentionally) in that commit. But I don’t see any reason why this function should not be tested at all.
