src: Make <==> more robust.
tests: Add test for pattern match failure.