Update test
Fix order of capturing of this inside switch statement. Fixes #12544