ERR?! - rename the function: test()

it seems that: test() is called because we used test -d $dir