def test_word_expand_rec(): word = Word([ConstantString("a/"), STARSTAR, ConstantString("/e")]) env = make_env() with make_dirs("a/b*/cfood/e", "a/b*/cd/e/f") as d: with cwd(d): ans = expand(env, word, ".") assert ans == ["a/b*/cd/e", "a/b*/cfood/e"]
def test_files_too(): word = Word([STAR]) env = make_env() with make_dirs("a", "b", ".c", ".d", TOUCH, "e", ".f") as d: with cwd(d): ans = expand(env, word, ".") assert ans == ["a", "b", "e"]
def test_more_dots(): word = Word([ConstantString("."), STAR]) env = make_env() with make_dirs("a", "b", ".c", ".d", TOUCH, "e", ".f") as d: with cwd(d): ans = expand(env, word, ".") assert ans == [".c", ".d", ".f"]
def test_no_dots(): word = Word([STAR, ConstantString("/..")]) env = make_env() with make_dirs("a", "b", ".c", ".d", TOUCH, "e", ".f") as d: with cwd(d): ans = expand(env, word, ".") assert ans == ["a/..", "b/.."]