---
source: src/patch/parse.rs
expression: patches
input_file: src/patch/test-data/0002-win-libraries-CMakeLists.txt.patch
---
Ok(
    [
        Patch {
            original: Some(
                Filename(
                    "CMakeLists.txt.old",
                ),
            ),
            modified: Some(
                Filename(
                    "CMakeLists.txt",
                ),
            ),
            hunks: [
                Hunk {
                    old_range: HunkRange {
                        start: 148,
                        len: 1,
                    },
                    new_range: HunkRange {
                        start: 148,
                        len: 3,
                    },
                    function_context: None,
                    lines: [
                        Context(
                            "endif()\n",
                        ),
                        Insert(
                            "string(REPLACE \".dll\" \"\" LLVM_LIBRARIES \"${LLVM_LIBRARIES}\")\n",
                        ),
                        Insert(
                            "list(APPEND LLVM_LIBRARIES \"xml2.lib\" \"zstd.lib\" \"zlib.lib\" \"msvcrt.lib\")\n",
                        ),
                    ],
                },
                Hunk {
                    old_range: HunkRange {
                        start: 725,
                        len: 2,
                    },
                    new_range: HunkRange {
                        start: 727,
                        len: 4,
                    },
                    function_context: None,
                    lines: [
                        Context(
                            "else()\n",
                        ),
                        Insert(
                            "target_compile_options(zigcpp PRIVATE -MD)\n",
                        ),
                        Insert(
                            "add_compile_options(/MD /wd4715 /wd4291)\n",
                        ),
                        Context(
                            "target_compile_options(zigcpp PRIVATE /Zc:preprocessor)\n",
                        ),
                    ],
                },
                Hunk {
                    old_range: HunkRange {
                        start: 847,
                        len: 1,
                    },
                    new_range: HunkRange {
                        start: 849,
                        len: 1,
                    },
                    function_context: None,
                    lines: [
                        Delete(
                            "  target_link_libraries(zig1 LINK_PUBLIC m)\n",
                        ),
                        Insert(
                            "  # target_link_libraries(zig1 LINK_PUBLIC m)\n",
                        ),
                    ],
                },
                Hunk {
                    old_range: HunkRange {
                        start: 933,
                        len: 2,
                    },
                    new_range: HunkRange {
                        start: 936,
                        len: 3,
                    },
                    function_context: None,
                    lines: [
                        Context(
                            "  -Dno-langref\n",
                        ),
                        Insert(
                            "  --search-prefix \"$ENV{PREFIX}/Library/lib\"\n",
                        ),
                        Context(
                            "  --maxrss 7000000000\n",
                        ),
                    ],
                },
                Hunk {
                    old_range: HunkRange {
                        start: 949,
                        len: 1,
                    },
                    new_range: HunkRange {
                        start: 1010,
                        len: 1,
                    },
                    function_context: None,
                    lines: [
                        Delete(
                            "if(ZIG_STATIC AND NOT MSVC)\n",
                        ),
                        Insert(
                            "if(ZIG_STATIC AND NOT MSVC)\n",
                        ),
                    ],
                },
            ],
        },
    ],
)
