t.Fatalf("wrong exit status %d; want 0\nstderr: %s",code,ui.ErrorWriter.String())
}
vargotfunctions
gotString:=ui.OutputWriter.String()
err:=json.Unmarshal([]byte(gotString),&got)
iferr!=nil{
t.Fatal(err)
}
iflen(got.Signatures)<100{
t.Fatalf("expected at least 100 function signatures, got %d",len(got.Signatures))
}
// check if one particular stable function is correct
gotMax,ok:=got.Signatures["max"]
wantMax:="{\"description\":\"`max` takes one or more numbers and returns the greatest number from the set.\",\"return_type\":\"number\",\"variadic_parameter\":{\"name\":\"numbers\",\"type\":\"number\"}}"
if!ok{
t.Fatal(`missing function signature for "max"`)
}
ifstring(gotMax)!=wantMax{
t.Fatalf("wrong function signature for \"max\":\ngot: %q\nwant: %q",gotMax,wantMax)