Tests for cycle detection