This is not a bug.
%test evaluates to &test, which is the represenatation of a binary variable. (/help binary variables)
And sockwrite will interpret binvars unless you specify the t switch, so change your sockwrite to:
//sockwrite -tn test %test
Ok thanks.