fn round_trip_parsing2(code_val: u32) {
        let utf32_box: [u32; 1] = [code_val; 1];
        let mut utf8_box: [u8; 4] = [0; 4];
        let mut utf8_len: usize = 0;

        let mut utf32_ref = & utf32_box[..];
        let mut utf32_parser = FromUnicode::new();
        loop {
            match utf32_parser.utf32_to_utf8(utf32_ref) {
                Result::Ok((utf32_pos, b)) => {
                    if code_val == REPLACE_UTF32 {
                        assert_eq!(true, utf32_parser.has_invalid_sequence());
                    }
                    utf8_box[utf8_len] = b;
                    utf8_len += 1;
                    utf32_ref = utf32_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        let mut utf8_ref = & utf8_box[0 .. utf8_len];
        let mut utf32_box2: [u32; 1] = [0; 1];
        let mut utf32_len: usize = 0;
        let mut utf8_parser = FromUtf8::new();
        loop {
            match utf8_parser.utf8_to_utf32(utf8_ref) {
                Result::Ok((utf8_pos, co)) => {
                    if code_val == REPLACE_UTF32 {
                        assert_eq!(true, utf8_parser.has_invalid_sequence());
                    }
                    utf32_box2[utf32_len] = co;
                    utf32_len += 1;
                    utf8_ref = utf8_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        assert_eq!(1, utf32_len);
        assert_eq!(code_val, utf32_box2[0]);
    }
// Have a char value go through a round trip of conversions.

Have a char value go through a round trip of conversions.
Have a char value go through a round trip of conversions .
fn round_trip_parsing2(code_val: u32) {
        let utf32_box: [u32; 1] = [code_val; 1];
        let mut utf8_box: [u8; 4] = [0; 4];
        let mut utf8_len: usize = 0;
        let mut utf32_ref = & utf32_box[..];
        let mut utf32_parser = FromUnicode::new();
        loop {
            match utf32_parser.utf32_to_utf8(utf32_ref) {
                Result::Ok((utf32_pos, b)) => {
                    if code_val == REPLACE_UTF32 {
                        assert_eq!(true, utf32_parser.has_invalid_sequence());
                    }
                    utf8_box[utf8_len] = b;
                    utf8_len += 1;
                    utf32_ref = utf32_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        let mut utf8_ref = & utf8_box[0 .. utf8_len];
        let mut utf32_box2: [u32; 1] = [0; 1];
        let mut utf32_len: usize = 0;
        let mut utf8_parser = FromUtf8::new();
        loop {
            match utf8_parser.utf8_to_utf32(utf8_ref) {
                Result::Ok((utf8_pos, co)) => {
                    if code_val == REPLACE_UTF32 {
                        assert_eq!(true, utf8_parser.has_invalid_sequence());
                    }
                    utf32_box2[utf32_len] = co;
                    utf32_len += 1;
                    utf8_ref = utf8_pos;
                }
                Result::Err(MoreEnum::More(_)) => {
                    break;
                }
            }
        }
        assert_eq!(1, utf32_len);
        assert_eq!(code_val, utf32_box2[0]);
    }
fn round_trip_parsing2 ( code_val : u32 ) { let utf32_box : [ u32 ; 1 ] = [ code_val ; 1 ] ; let mut utf8_box : [ u8 ; 4 ] = [ 0 ; 4 ] ; let mut utf8_len : usize = 0 ; let mut utf32_ref = & utf32_box [ .. ] ; let mut utf32_parser = FromUnicode :: new ( ) ; loop { match utf32_parser . utf32_to_utf8 ( utf32_ref ) { Result :: Ok ( ( utf32_pos , b ) ) => { if code_val == REPLACE_UTF32 { assert_eq ! ( true utf32_parser has_invalid_sequence ( ) ) ; } utf8_box [ utf8_len ] = b ; utf8_len += 1 ; utf32_ref = utf32_pos ; } Result :: Err ( MoreEnum :: More ( _ ) ) => { break ; } } } let mut utf8_ref = & utf8_box [ 0 .. utf8_len ] ; let mut utf32_box2 : [ u32 ; 1 ] = [ 0 ; 1 ] ; let mut utf32_len : usize = 0 ; let mut utf8_parser = FromUtf8 :: new ( ) ; loop { match utf8_parser . utf8_to_utf32 ( utf8_ref ) { Result :: Ok ( ( utf8_pos , co ) ) => { if code_val == REPLACE_UTF32 { assert_eq ! ( true utf8_parser has_invalid_sequence ( ) ) ; } utf32_box2 [ utf32_len ] = co ; utf32_len += 1 ; utf8_ref = utf8_pos ; } Result :: Err ( MoreEnum :: More ( _ ) ) => { break ; } } } assert_eq ! ( 1 utf32_len ) ; assert_eq ! ( code_val utf32_box2 [ 0 ] ) ; }
Have a char value go through a round trip of conversions.
Have a char value go through a round trip of conversions .
code_val
u32
code_val
u32