Blob


1 include "lib.9ps"
3 # TODO: add a test that tries to do a walk after opening a fid for i/o.
5 testing "walk to a directory" dir "./root" {
6 mount(0, "/")
7 walk(0, 1, "dir", "subdir")
9 m = recv()
10 assert (
11 m.type == Rwalk
12 m.nwqid == 2
13 m.wqid.0.type == QTDIR
14 m.wqid.1.type == QTDIR
15 )
16 }
18 testing "walk to a file" dir "./root" {
19 mount(0, "/")
20 walk(0, 1, "dir", "subdir", "file")
22 m = recv()
23 assert (
24 m.type == Rwalk
25 m.nwqid == 3
26 m.wqid.0.type == QTDIR
27 m.wqid.1.type == QTDIR
28 m.wqid.2.type == QTFILE
29 )
30 }
32 testing "walk with invalid fid" dir "./root" {
33 mount(0, "/")
34 walk(1, 2)
35 expect-error()
36 }