I didn't check but unittests for this would be awesome!