- Cleaned up old tests
- Changed `node:buffer` and `node:streams` imports to native `WebWorkers` imports; - Fixed tests that used old `toPtr` and `fromPtr` functions to use the new NodePointer class methods - Exposed pointer resolution helper functions to the consumer
This commit is contained in:
@@ -4,12 +4,11 @@
|
||||
|
||||
import { FileSystem } from "@core/filesystem/filesystem";
|
||||
import {
|
||||
NodePointer,
|
||||
NodeType,
|
||||
toPtr,
|
||||
type DirectoryNode,
|
||||
type FileNode,
|
||||
type Node,
|
||||
type NodePointer,
|
||||
type SymlinkNode,
|
||||
} from "@core/filesystem/node";
|
||||
import { DefaultVDiskConfig } from "@core/filesystem/vdisk";
|
||||
@@ -63,7 +62,7 @@ export function makeSymlink(inode: number, target: string): SymlinkNode {
|
||||
};
|
||||
}
|
||||
|
||||
export function makeUser(home: NodePointer = toPtr({ device_id: 0, inode: 0 })): UserInfo {
|
||||
export function makeUser(home: NodePointer = NodePointer.of(0, 0)): UserInfo {
|
||||
return {
|
||||
username: "test",
|
||||
uid: 1000,
|
||||
@@ -162,7 +161,7 @@ export function makeShellState(
|
||||
fs: FileSystem,
|
||||
opts: { cwd?: NodePointer; home?: NodePointer; user?: UserInfo } = {},
|
||||
): ShellState {
|
||||
const cwd = opts.cwd ?? toPtr({ device_id: 0, inode: 0 });
|
||||
const cwd = opts.cwd ?? NodePointer.of(0, 0);
|
||||
const user = opts.user ?? makeUser(opts.home);
|
||||
const session = {
|
||||
user,
|
||||
|
||||
Reference in New Issue
Block a user