~samwhited/xmpp

ref: 52be89df867be9fc4e8ba83b0c3880887a6485ba xmpp/jid/jid_test.go -rw-r--r-- 6.5 KiB
XEP-0106: Create JID Escaping text transformer

Fixes #24
Remove allocations on JID string splitting

((3413c65...)) $ go test -bench BenchmarkSplit -benchmem
BenchmarkSplit-4         5000000               253 ns/op              64 B/op          2 allocs/op

(master) $ go test -bench BenchmarkSplit -benchmem
BenchmarkSplit-4        50000000                30.5 ns/op             0 B/op          0 allocs/op

See #23
jid: Fix panic when comparing with nil JID

Also when unmarshaling an empty attr
Add field names to struct in test
Make JIDs satisfy MarshalXML and UnmarshalXML
jid: Add more escape/unescape tests
jid: Support unescaping uppercase escape codes
jid: Add helpers for XEP-0106: Jid Escaping
jid: Improve test coverage
jid: Add some tests to make sure MustParse panics
Don't fail on marshaling nil JID pointer
jid: Fix tests
Have JIDs implement net.Addr

I'm not entirely sure this makes sense; on the one hand, they are
addresses, on the other, the net package only supports a few protocols
and all of it's Dial methods take a string of the network type; making
up a new one probably breaks the point of having the Addr interface. I
suspect this was a bad design choice in the net package, as it rather
weakens the contract. Or maybe that's not the point of having a function
to return the network? I'm really not sure.

This should be considered experimental and may be reverted.
Add more JID test cases
Allocate fewer JID's during testing
Simplify the JID API

Fixes mellium/mel#14
Add compile time regression tests
Tweak JID documentation
Make JID API higher level (no PRECIS mentions)

Use the new golang.org/x/text/unicode/precis under the hood
Subtree merge remote-tracking branch 'jid/master'