Add test for SPARK-1877. (Fixed in 52eb54d.)