Add tests for core graph functions