1 fb1a36c0 2022-01-09 op include "lib.9ps"
3 fb1a36c0 2022-01-09 op # TODO: add a test that tries to do a walk after opening a fid for i/o.
5 a0ec53a2 2022-01-09 op testing "walk to a directory" {
7 fb1a36c0 2022-01-09 op walk(0, 1, "dir", "subdir")
11 fb1a36c0 2022-01-09 op m.type == Rwalk
13 fb1a36c0 2022-01-09 op m.wqid.0.type == QTDIR
14 fb1a36c0 2022-01-09 op m.wqid.1.type == QTDIR
18 a0ec53a2 2022-01-09 op testing "walk to a file" {
20 fb1a36c0 2022-01-09 op walk(0, 1, "dir", "subdir", "file")
24 fb1a36c0 2022-01-09 op m.type == Rwalk
26 fb1a36c0 2022-01-09 op m.wqid.0.type == QTDIR
27 fb1a36c0 2022-01-09 op m.wqid.1.type == QTDIR
28 fb1a36c0 2022-01-09 op m.wqid.2.type == QTFILE
32 a0ec53a2 2022-01-09 op testing "can't walk from a file" {
35 fb1a36c0 2022-01-09 op walk(0, 1, "dir", "a-file")
38 fb1a36c0 2022-01-09 op walk(1, 2, "subdir", "file")
39 fb1a36c0 2022-01-09 op expect-error()
42 a0ec53a2 2022-01-09 op testing "walk with invalid fid" {
45 fb1a36c0 2022-01-09 op expect-error()
48 a0ec53a2 2022-01-09 op testing "walk with empty string" {
50 fb1a36c0 2022-01-09 op walk(0, 1, "")
51 fb1a36c0 2022-01-09 op expect-error()
54 a0ec53a2 2022-01-09 op testing "walk to a non-existant file" {
56 fb1a36c0 2022-01-09 op walk(0, 1, "non-exists")
57 fb1a36c0 2022-01-09 op expect-error()
60 a0ec53a2 2022-01-09 op testing "walk with an invalid component" {
62 fb1a36c0 2022-01-09 op walk(0, 1, "/non-exists")
63 fb1a36c0 2022-01-09 op expect-error()
66 a0ec53a2 2022-01-09 op testing "zero-path walk don't reply with a qid" {
71 fb1a36c0 2022-01-09 op m.type == Rwalk