test for label in ancestors