Add some tests for various reflection functions

Added a few tests to prevent a regression like the one fixed by #8239. Also added a couple other tests while I was looking at reflection.jl.