(#23131) Add a spec test asserting that main is treated like other classes