Flow of a long bubble in a square capillary