Add test for new self-dependency behavior