tests for swap