func ExampleDict() { d1 := lich.Dict{ "selling points": lich.ArrayFromStrings("simple", "general", "human-sympathetic"), "greeting": lich.DataString([]byte{72, 101, 108, 108, 111}), "fruit": lich.Array{lich.DataString("apple"), lich.DataString("banana"), lich.DataString("orange")}, } fmt.Println(d1) //Output: 119{5<fruit>26[5<apple>6<banana>6<orange>]8<greeting>5<Hello>14<selling points>40[6<simple>7<general>17<human-sympathetic>]} }
func TestEmptyData(t *testing.T) { data := lich.DataString("") str := data.String() if str != "0<>" { t.Fatal(data, str) } }
func ExampleData() { data := lich.DataString("Hello, World!") fmt.Println(data) //Output: 13<Hello, World!> }
func ExampleArray() { array := lich.Array{lich.DataString("apple"), lich.DataString("banana"), lich.DataString("orange")} fmt.Println(array) //Output: 26[5<apple>6<banana>6<orange>] }