refactored test_g_edges