fn no_overflow_when_lines_spill_out_of_function()

in src/line.rs [256:294]


    fn no_overflow_when_lines_spill_out_of_function() {
        let function_sym_len = 0x9;
        let mut lines = Lines::new();
        lines.add_line(0x10, 100, 0);
        lines.add_line(0x18, 102, 0);
        lines.add_line(0x14, 101, 0);
        lines.add_line(0x1c, 103, 0);
        lines.finalize(0x10, function_sym_len); // function ends at 0x19

        assert_eq!(
            lines.lines,
            vec![
                Line {
                    rva: 0x10,
                    len: 0x4,
                    num: 100,
                    file_id: 0
                },
                Line {
                    rva: 0x14,
                    len: 0x4,
                    num: 101,
                    file_id: 0
                },
                Line {
                    rva: 0x18,
                    len: 0x4, // This len is questionable (we could also limit it to 0x1, i.e. 0x19 - 0x18), but it doesn't really matter
                    num: 102,
                    file_id: 0
                },
                Line {
                    rva: 0x1c,
                    len: 0, // 0x1c > 0x19, so we don't compute a len for this last line record.
                    num: 103,
                    file_id: 0
                },
            ]
        );
    }