To beat the sword in the Impossible Test, tap Defend. A shield will appear at the bottom right of the screen. Move the shield so it blocks the sword from piercing the right edge.