lib9p

Go 9P library.
Log | Files | Refs

commit 6a86439019a2a2a7532185a0710d667f8f36045e
parent fa7dc51876530daa2bced6c3f8c7ff87b4e1fd0c
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Thu, 19 Oct 2023 11:51:54 +0900

add qid_test

Diffstat:
Aqid_test.go | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/qid_test.go b/qid_test.go @@ -0,0 +1,22 @@ +package lib9p + +import ( + "reflect" + "testing" +) + +func TestQidMarshal(t *testing.T) { + tests := []struct { + name string + qid Qid + }{ + {"0", Qid{}}, + {"1", Qid{QTDIR, 2, 3}}, + } + for _, test := range tests { + got := unmarshalQid(test.qid.marshal()) + if !reflect.DeepEqual(got, test.qid) { + t.Errorf("%s: got: %v, want: %v", test.name, got, test.qid) + } + } +} +\ No newline at end of file