[test] Add test for self-dependencies