def test_exclude():
    fl = t.FileList("x.c", "abc.c", "xyz.c", "existing")
    x = fl.exclude_re(r"x.+\.")
    t.isinstance(x, t.FileList)
    t.eq(sorted(fl), ["abc.c", "existing", "x.c"])
    t.eq(id(fl), id(x))
    fl.exclude("*.c")
    t.eq(fl, ["existing"])
    fl.exclude("existing")
    t.eq(fl, [])
Example #2
0
def test_exclude():
    fl = t.FileList("x.c", "abc.c", "xyz.c", "existing")
    x = fl.exclude_re(r"x.+\.")
    t.isinstance(x, t.FileList)
    t.eq(sorted(fl), ["abc.c", "existing", "x.c"])
    t.eq(id(fl), id(x))
    fl.exclude("*.c")
    t.eq(fl, ["existing"])
    fl.exclude("existing")
    t.eq(fl, [])
def test_exclude_filename():
    fl = t.FileList("*.c").exclude("abc.c")
    t.eq(sorted(fl), ["x.c", "xyz.c"])
    t.isinstance(fl, t.FileList)
def test_exclude_re():
    fl = t.FileList("*").exclude_re(r".*\.[hcx]$")
    t.eq(sorted(fl), ["existing", "x"])
    t.isinstance(fl, t.FileList)
Example #5
0
def test_exclude_filename():
    fl = t.FileList("*.c").exclude("abc.c")
    t.eq(sorted(fl), ["x.c", "xyz.c"])
    t.isinstance(fl, t.FileList)
Example #6
0
def test_exclude_re():
    fl = t.FileList("*").exclude_re(r".*\.[hcx]$")
    t.eq(sorted(fl), ["existing", "x"])
    t.isinstance(fl, t.FileList)