added an inode resolver to convert inodes to absolute path strings
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { resolvePath } from "@core/path_resolver";
|
||||
import { resolveInode, resolvePath } from "@core/path_resolver";
|
||||
import { expectNodeNotFoundError, expectNotADirectoryError } from "@tests/helpers/error_matchers";
|
||||
import { buildTestFS } from "@tests/helpers/filesystems_fixture";
|
||||
import { depth7Tree } from "@tests/helpers/tree_fixture";
|
||||
@@ -61,3 +61,13 @@ describe("resolvePath", () => {
|
||||
expectNodeNotFoundError(() => resolvePath(fs, 69, "/d3"));
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveInode", () => {
|
||||
test("returns an the path from the d4 node", () => {
|
||||
expect(resolveInode(fs, 4)).toBe("/d1/d2/d3/d4");
|
||||
});
|
||||
|
||||
test("returns an empty string from a non existent inode", () => {
|
||||
expect(resolveInode(fs, 999)).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user