Performance of a tungsten-cerium fluoride sampling calorimeter in high-energy electron beam tests