qid_test.go (366B)
1 package lib9p 2 3 import ( 4 "reflect" 5 "testing" 6 ) 7 8 func TestQidMarshal(t *testing.T) { 9 tests := []struct { 10 name string 11 qid Qid 12 }{ 13 {"0", Qid{}}, 14 {"1", Qid{QTDIR, 2, 3}}, 15 } 16 for _, test := range tests { 17 got := unmarshalQid(test.qid.marshal()) 18 if !reflect.DeepEqual(got, test.qid) { 19 t.Errorf("%s: got: %v, want: %v", test.name, got, test.qid) 20 } 21 } 22 }