Add dirname detection to simple tests.