blob: 31631ef4621956624bd9825af4917054dc86c1fc [file] [log] [blame]
Sasha Smundak24159db2020-10-26 15:43:21 -07001# Tests file ops builtins
2load("assert.star", "assert")
3
4
5def test():
6 myname = "file_ops.star"
Sasha Smundak3c569792021-08-05 17:33:15 -07007 assert.true(rblf_file_exists("."), "./ exists ")
Sasha Smundak24159db2020-10-26 15:43:21 -07008 assert.true(rblf_file_exists(myname), "the file %s does exist" % myname)
9 assert.true(not rblf_file_exists("no_such_file"), "the file no_such_file does not exist")
10 files = rblf_wildcard("*.star")
11 assert.true(myname in files, "expected %s in %s" % (myname, files))
12 # RBCDATADIR is set by the caller to the path where this file resides
13 files = rblf_wildcard("*.star", rblf_env.TEST_DATA_DIR)
14 assert.true(myname in files, "expected %s in %s" % (myname, files))
15 files = rblf_wildcard("*.xxx")
16 assert.true(len(files) == 0, "expansion should be empty but contains %s" % files)
17
18
19test()