Add test for ROOT-6124.