~ chicken-core (chicken-5) /tests/test-glob.scm
Trap12;;;; test-glob.scm34;; test glob-pattern -> regex translation56(import (chicken irregex))78(assert (irregex-match (glob->sre "foo.bar") "foo.bar"))9(assert (irregex-match (glob->sre "foo*") "foo.bar"))10(assert (irregex-match (glob->sre "foo/*") "foo/bar"))11(assert (not (irregex-match (glob->sre "foo/*") "foo/bar/baz")))12(assert (irregex-match (glob->sre "foo/*/*") "foo/bar/baz"))13(assert (not (irregex-match (glob->sre "foo/*") "foo/.bar")))14(assert (irregex-match (glob->sre "*foo") "xyzfoo"))15(assert (not (irregex-match (glob->sre "*foo") ".foo")))16(assert (not (irregex-match (glob->sre "*foo*") "a.fooxxx/yyy")))17(assert (irregex-match (glob->sre "*foo*") "fooxxx"))18(assert (irregex-match (glob->sre "main.[ch]") "main.c"))19(assert (irregex-match (glob->sre "main.[ch]") "main.h"))20(assert (not (irregex-match (glob->sre "main.[ch]") "main.cpp")))21(assert (irregex-match (glob->sre "main.[-c]") "main.h"))22(assert (not (irregex-match (glob->sre "main.[-h]") "main.h")))2324;; test file globbing2526(import (chicken file))2728(assert (pair? (glob "../tests")))29(assert (pair? (glob "../tests/*")))30(assert (null? (glob "../nowhere")))31(assert (null? (glob "../nowhere/*")))