fork of indigo with slightly nicer lexgen
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

lex: test for TestNewFromType

+17
+17
lex/util/decoder_test.go
··· 20 20 t.Fatal("expected an error marshalling a nil (but not a panic)") 21 21 } 22 22 } 23 + 24 + func TestNewFromType(t *testing.T) { 25 + 26 + raw, err := NewFromType("blob") 27 + if err != nil { 28 + t.Fatal(err) 29 + } 30 + blob := raw.(*LexBlob) 31 + if blob.Size != 0 { 32 + t.Fatal("expect default/nil LexBlob") 33 + } 34 + 35 + _, err = NewFromType("bogus.type") 36 + if err == nil { 37 + t.Fatal("expect bogus generation to fail") 38 + } 39 + }