def METHOD_NAME(fortran_reader, fortran_writer, test_case):
    ''' Check that the transformation works as expected. '''
    input_code, expected = test_cases[test_case]
    trans = FoldConditionalReturnExpressionsTrans()
    file_container = fortran_reader.psyir_from_source(input_code)
    subroutine = file_container.children[0]
    trans.apply(subroutine)
    assert fortran_writer(subroutine) == expected