test to see if directory matches