Add unit test

Fails for 3.6.1. Passes as of 83f483f4a4fc51e9949577c006c491eb331a1664