#! /bin/sh # $NetBSD: patch.sh,v 1.1 2020/04/26 12:46:01 rillig Exp $ # # Test cases for patching files using patch(1). # set -eu . "./test.subr" if test_case_begin "patch matches exactly"; then cd "$tmpdir" create_file_lines "to-be-patched" \ "1" "2" "3" "4" "5" "6" "7" create_file "4-four.patch" < "stderr" \ && exitcode=0 || exitcode=$? assert_that "$exitcode" --equals "0" assert_that "stderr" --file-is-lines \ "No such line 999 in input file, ignoring" assert_that "to-be-patched" --file-is-lines \ "1" "2" "3" "four" "5" "6" "7" test_case_end fi