Add test for swap_ranges in the algorithm component