I've updated http://wowwiki.wikia.com/wiki/Creating_a_slash_command, fixing the examples and I added a simple starter example at the top with a condensed explanation of the mechanism and rules.
Some of the examples were unclear, but more importantly the actual rules for naming were fairly buried, which is where the OP was having issues.
The new top example reads:
SLASH_TEST1 = "/test1"
SLASH_TEST2 = "/addontest1"
SlashCmdList["TEST"] = function(msg)
print("Hello World!")
end
This was not totally your fault. :)
Before edit:
Same text as above basically, except I had misremembered and the code I used to spot check was complex and I misinterpreted it. I gave wrong information above on naming above (and edited the whole wiki article the same way). Both are fixed now. Comment below complaining was to the original answer I made here.