Bob/tests/test_os_basic.bob
Bobby Lucero 7f7c6e438d Started fleshing out built in modules.
added policy templates for module safety
2025-08-12 03:26:50 -04:00

30 lines
763 B
Plaintext

print("\n--- Test: os basic ---");
import os;
var cwd = os.getcwd();
assert(type(cwd) == "string", "getcwd returns string");
var pid = os.getpid();
assert(type(pid) == "number", "getpid returns number");
var nm = os.name();
assert(type(nm) == "string", "name returns string");
var sep = os.sep();
var psep = os.pathsep();
var lsep = os.linesep();
assert(type(sep) == "string" && type(psep) == "string" && type(lsep) == "string", "separators are strings");
// listdir should return array
var listing = os.listdir(".");
assert(type(listing) == "array", "listdir returns array");
// exists/isdir should be true for current dir
assert(os.exists(".") == true, "exists(.) is true");
assert(os.isdir(".") == true, "isdir(.) is true");
print("os basic: PASS");