MoveNext() will bring it to the first ‘yield’ statement. You’ll have to iterate until MoveNext returns false, if you want the entire method to process.
var e = test();
while(e.MoveNext()) { }
Of course, most coroutine iterators expect the yield statements to wait until the next frame. So if you have one that can result in infinite yielding, or really long processes, this will most certainly resulting in blocking/freezing the program.
I used custom coroutines like this for one of my projects. I basically created a system of “Yield until the user meets certian objectives”. Made for an interesting approach to a quest system.